Showing posts with label guys. Show all posts
Showing posts with label guys. Show all posts

Sunday, March 25, 2012

Customising report Manager

Hi guys
I just want user see only content tab in Report Manager and not the property
tab .
I create a new role and select 'VIEW ROLE' and 'VIEW REPORT' tasks,
descriptions says that user will be able to see the properties too. I dont
want let user see the property.
Niether should user see the subscription link.
How could I achieve that
Sincerely
AmeetI don't think it is possible to give a set of permissions where a user will
be able to view the report and not see the properties of the report. If you
don't 'Manage Individual Subscriptions' or 'Manage All Subscriptions'
permissions then they will not see the subscription tab.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ameet" <Ameet@.discussions.microsoft.com> wrote in message
news:2A20E4F6-1158-4845-8032-69DA31902816@.microsoft.com...
> Hi guys
> I just want user see only content tab in Report Manager and not the
property
> tab .
> I create a new role and select 'VIEW ROLE' and 'VIEW REPORT' tasks,
> descriptions says that user will be able to see the properties too. I dont
> want let user see the property.
> Niether should user see the subscription link.
> How could I achieve that
> Sincerely
> Ameetsql

Wednesday, March 7, 2012

Custom DLL #Error Issue -Really Critical - Need your Help to Sort out the Issue

Hi MSTR Mentors,
I am in need of your Help... I am having this issue for a very long
time...Hope I will get a solution from you guys...
We have a Custom .net dll, referred in the RDL, the dll has a function
which gets the encrypted Credit Card# and returns the Decrypted value to
the Report.
I have done all the steps listed below
1. Assert permissions in your custom assembly.
2. Make the custom assembly available to Report Designer and to Report
Server.
3. Reference the custom assembly in your report.
4. Modify the code access security settings for your custom assembly.
Ref: http://support.microsoft.com/?kbid=842419#XSLTH3133121123120121120120
Step 1: I have added the following code to Assert Permission.
SecurityPermission secPerm = new SecurityPermission
(PermissionState.Unrestricted);
secPerm.Assert(); - Is this Assert Permission Correct
Step 2: Copied the assembly to the following locations
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\
bin
&
C:\Program Files\Microsoft SQL Server\80\Tools\Report Designer
Step 3: Reference the custom assembly in the report (thru Report Properties)
Step 4: Modify the code access security for the custom assembly by creating
new permission set and code groups.
Copy the code from the security.config(C:\WINNT\Microsoft.NET\Framework\
v1.1.4322\CONFIG\) and paste it in
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\
rssrvpolicy.config
&
C:\Program Files\Microsoft SQL Server\80\Tools\Report Designer\
rspreviewpolicy.config
PERMISSION SET
<PermissionSet class="NamedPermissionSet"
version="1"
Name="ILNReportsPermissionSet">
<IPermission class="SecurityPermission"
version="1"
Flags="Assertion, Execution"/>
</PermissionSet>
CODE GROUP
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="TESTPS"
Name="TESTCG"
Description="">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="file://C:/Program
Files/Microsoft SQL Server/MSSQL/Reporting
Services/ReportServer/bin/CreditCardDecrypt.dll"/>
</CodeGroup>
Save and close the files
The tried to run the report in the DebugLocal Mode - Fails ?
Dll Code: I have attached the custom assembly code.
Note: To make sure the Dll works fine in Web, I have created a sample web
application and tested the dll by passing the values to the dll function It
works fine, but not working with the RDL.
Custom DLL Code
using System;
using System.Text;
using System.Net;
using System.IO;
using System.Collections.Specialized;
using System.Configuration;
using System.Security.Permissions;
using System.Security.Cryptography;
using FCLX509 = System.Security.Cryptography.X509Certificates;
using WSEX509 = Microsoft.Web.Services2.Security.X509;
using WSECRY = Microsoft.Web.Services2.Security.Cryptography;
[assembly:CLSCompliant(true)]
namespace CreditCardDecrypt
{
/// <summary>
/// Summary description for DecryptClass.
/// </summary>
///
public class DecryptClass
{
public DecryptClass()
{
//
// TODO: Add constructor logic here
//
}
public static string DecryptCardInfo(string cc,string subjectName,string
storeName)
{
string sCreditCard = "";
try
{
if(cc == "" || cc== null)
return sCreditCard = "NA";
SecurityPermission secPerm = new SecurityPermission
(PermissionState.Unrestricted);
secPerm.Assert();
WSEX509.X509CertificateStore.StoreLocation location = WSEX509.X509CertificateStore.StoreLocation.LocalMachine;
WSEX509.X509CertificateStore.StoreProvider provider = WSEX509.X509CertificateStore.StoreProvider.System;
WSEX509.X509CertificateStore store = new WSEX509.X509CertificateStore
(provider, location, storeName);
bool fopen = store.OpenRead();
if(fopen)
{
WSEX509.X509CertificateCollection certs = store.FindCertificateBySubjectString(subjectName);
if (certs.Count > 0)
{
WSEX509.X509Certificate cer = certs[0];
WSECRY.RSACryptoServiceProvider rsaCsp = (WSECRY.RSACryptoServiceProvider)cer.Key;
byte[] cipherData = Convert.FromBase64String(cc);
byte[] plainData = rsaCsp.Decrypt(cipherData, false);
sCreditCard = Encoding.UTF8.GetString(plainData);
}
}
if (store != null)
store.Close();
return sCreditCard;
//return cc;
}
catch(Exception ex)
{
return ex.ToString();
}
}
}
}
Thanks
Balaji
Note : This is my email id (bkkrishnan[AT]hotmail.com).
--
Message posted via http://www.sqlmonster.comCan any one please help on this.....
Still can't able to fix the issue
Thanks
Balaji
--
Message posted via http://www.sqlmonster.com

Friday, February 24, 2012

Custom Code....

Hey guys I have a problem I am trying to solve using custom code but I am open to other solutions.

Situation: I have multiple reports that the user can see. Example (Move In Corp. report, Move In Region report,Move In Division report, Mid Year Corp. report, Mid Year Region report,Mid Year Division report etc.) I have a stored procedure that returns all the information needed based upon the UserID being passed from the report to the stored procedure.

Goal: When the user logs in I want to be able to foward the user to a specific report based upon their userid (global in RS). I currently have three textboxes(Move In, Mid Year, Year End) with navigation enabled to jump to another report. The report to which the user is passed to is determined by an expression which is something like this for the Move In text box =IIF(Fields!orgtypeid.Value = 1,"Move In Corp","Move In Region"). The orgtypeid.value is returned by the stored procedure. I want to be able to forward the user a specific Move In report (Move In Corp, Move In Region, etc) without having the user select the textbox.

Any suggestions are greatly appreciated.

TTT|||

You can try using subreports.

Make a topmost "switch" report that hosts three subreports and make Hidden value on each subreport an expression that returns true depending on the user type. This will not eliminate execution of all three reports but it will show only one that's needed.
The second step would be to make a switch report such that is executes only the needed report. To do this you will need to wrap each subreport in a separate dataregion (List for example) and make sure that datasets for each data region are built in such a way that only one dataset returns a row, while other two return empty sets.
I have not tried the second step myself, but it might be worth exploring

|||

Thanks for the response the first option is out simply because of performance issues.

This will be a dashboard used by a rather large company. I will look into the second option, in the mean time if anyone else has any other ideas I would welcome them now.

Thanks Alexandre!

Tuesday, February 14, 2012

cursors are bad

These guys I work with have some sql scripts they run over night and they bog down the server and the machine will be gummed up in the morning etc..

Well, I finally looked at this processing and the culprit is cursors. And cursors within cursors. I would like to just get some opinions about what would be more processor efficient so I can send my boss a link to this thread.

Using a cursors to pull records and update them.

vs

Create script using a scripting language that pulls the records through ADO, loops through them and performs updates as necessary using update statements and the like.

Be nice. I have to work with these guys.In my experience, T-SQL cursors are a generally bad idea. Most books I have read use the first page of the cursors chapter to say how bad cursors can be, then go on to describe how to build one.

In order to see how cursors impact performance, I have found that the best way to show people how bad they are, is to show them a perfmon with a pretty line showing CPU usage. Then run the cursor, and point out the big spike. Then ask them to imagine what happens when 4 or 5 more people run that cursor at the same time...

You should also mention that multiple application servers can be added on, but you will always be cursed with a single database machine. If the database machine is resource bound, no amount of extra application servers can help you.

As for how ADO stacks up, you may have to stage a race between a couple of processes. One T-SQL cursor based, and the other ADO based, and see who wins.

Hope this helps.|||And nested cursors are extremely bad...

The must open the first,
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close
then open then next, Fetch and then close

Put a dress on a cursor and you know what you have?

Anyway...You could just do it a set based method..

Got a sample of some code?|||At least in my experience, set-based solutions are at least one order of magnitude (ten times) faster than cursors in Microsoft SQL. They are often much faster than that, but the 10 times benchmark is easy to hit so that's all that I claim up front.

In every form of data processing, the closer you can keep the processing to the hardware itself, the faster the process runs. Cache is faster than disk, set based solutions on the SQL Server are faster than cursors, which can be faster than ADO under the right circumstances.

Rather than argue for ages or produce/quote meaningless benchmarks, I'd suggest you try it. Take a very simple process that affects many rows and rewrite it as either ADO, set based, or both. Compare doing the same task all three ways.

I'm confident that the set based solution will comfortably outperform any other way of solving the problem. ADO will probably come next, depending on the amount of network I/O it has to do. I'd expect the cursor to come in dead last.

I'd really like to hear your results when you get them!

-PatP|||thanks guys.

I have what looks like a few hundred .sql files. I have done set based querying before. I am not as tough as you guys but I am studying everyday.|||Can post or attach a small one so we can take a look?|||if it was my code I would but I probably should'nt because I gave the CIO a link to the thread.

95% chance they won't do anything with the advice. there is never any time or resources for anything here. they brought me into fix things and they tied my hands in the first week I was here by telling me I could not change any of the existing stuff and everything had to be a workaround.

I have told myself I have to stick it out for a year and then I would evaluate the situation. It's almost been 6 months.|||OK...

What I would do.

From a client, use Profiler to record some statistics.

Then "clone" and existing cursor process with a set based solution. Give us some "examples" that are close to what yo uhave so we can help.

Make sure the results produced are identical...write them to work tables for proof.

Publish your results.

If the results are anywhere what I expect it should be clear that it should be rewritten...it can be done a little at a time, and not everything has to be done...just find the biggest offenders...

How big is the database?

I'd dump and restore a copy of production so you can have your own dev environement...

Anyway...good luck

CIO

Constantly Ignorant Officer|||Check you calendar. It's probably only been two weeks, and just SEEMS like six months.

How are you supposed to fix anything if you can't change anything?

Do you take your car into the shop and say, "Make it run better, but don't touch the engine?"

Seems like the only thing you could recommend would be a massive upgrade to the hardware. See how they like the price-tag on that.|||Blindman,

Trust me I know. They have already talked hardware. In my last company, a few years ago when I was just a pup of a developer they beefed up the db server hardware for crappy application they were running and saw little or no gain because the code was so bad. they finally revamped the app and it was'nt until then that things got better.

I am thinking about switching auto shops. I am going to reproduce things on my local like Brett said when I get a chance. Maybe this weekend. I have app development to do today.