Rendering A Report Using Custom Assembly
May 17, 2007
I have created a custom assembly and referenced it and the program builds successfully. When I try to run the report in design mode, it will not render, it throws an exception when it tries to create a PDF. When I remove the assembly, the reports work well. So I'm not sure what it is that I'm doing wrong - does anyone have any suggestions?
namespace Calculations
{
public class calcPercentage
{
public static decimal Percentage(decimal decValueOne, decimal decValueTwo)
{
decimal decPercentage = 0;
if (decValueOne == 0 || decValueTwo == 0)
{
decPercentage = 0;
}
else
{
decPercentage = (decValueOne - decValueTwo) / decValueOne;
}
return decPercentage;
}
}
}
Then in my textbox I put:
=Calculations.CalcPercentage.Percentage(SUM(Fields!PreviousYTDExpenseAmount.Value, "Template_OutputData_Sales"), SUM(Fields!PreviousYTDExpenseAmount.Value, "Template_OutputData_CGS"))
I referenced the assembly and added it to C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssemblies and I still get that error message so I do not know what the problem is.
The line where the exception occurs happens here:
byte[] bytes = MyReport.rvOutput.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
Thanks so much for you help! If you have any suggestions about my next error...i'm all ears!
View 7 Replies
ADVERTISEMENT
Mar 18, 2008
Hello everyone,
I created a custom assembly using C# to transform some binary data into text, and in this assembly I used one win32 dll developed by our customer to help me to do the tranformation.
The code I used to call the win32 dll is like below:
[DllImport("tdasuie.dll", EntryPoint = "AlrtLogConditionToText",
ExactSpelling = false, CharSet = CharSet.Auto, SetLastError = true)]
private static extern UInt32 AlrtLogConditionToText(Byte[] pbCondition, StringBuilder pszText, UInt32 dwSize);
I defined a C# method to call the above win32 method and return a string. Then in the report, I called this C# method to get the correct string.
In the report designer, the C# method in the custom assembly can return the correct string in the preview window. But after I deployed the report into the report server, the textbox will only display "#error" in the report manager web page.
Can anybody help me on it? Thanks a lot.
Danny
View 4 Replies
View Related
Mar 14, 2007
How do I reference report items (such as textboxes, datasets, tables, etc...) from within a custom assembly?
Thanks!
View 3 Replies
View Related
Jun 3, 2015
I'm trying to add a custom report format to ssrs 2005 as per this [URL] I've added the code snippets in the example to three different ssrs 2005 server RSReportServer.config files but it does not work i.e do not show up in the export drop down when rendering report.
I've tried starting and stopping reporting services and it still does not works.
I've also modified the existing csv extension  with different options to see if it works but to no avail.However it works with SSRS2008 R2 . In fact it works right after I saved the config file, no restart needed.For SSRS2005 the file is in C:Program FilesMicrosoft SQL ServerMSSQL.3Reporting ServicesReportServer. I checked the registry setting  just to make sure I'm looking at the correct installation 'HKEY_LOCAL_MACHINE', 'SOFTWAREMicrosoftMicrosoft SQL Server90ToolsClientSetup', 'SQLPath' The three ssrs2005 instances are in three different physical servers and the problem is with all of them so it is not an isolated incident. I've dbowner rights to all three servers. The server versions are 9.0.4060, 9.0.4035 and 9.0.4053
View 11 Replies
View Related
Dec 11, 2013
I am using the QRCode4CS class [URL] .... to generate QR codes.
I can use the following code to successfully return a bitmap image to a picturebox in a Windows Form Application.
public class CreateQRCodeClass
{
public static Image CreateQRCodeImage(string inputString)
{
QRCode4CS.QRCode qrcode = new QRCode4CS.QRCode(new QRCode4CS.Options(inputString));
qrcode.Make();
[Code] ....
In trying to adapt the same code (below) to display a QR code in an SSRS report I get the error "There is an error on line 1 of custom code: [BC30311] Value of type 'System.Drawing.Image' cannot be converted to '1-dimensional array of Byte.'
Here is the custom code I am using.
Public Function QRCode(ByVal RetailerId As String) as Byte()
Return QRCode4CSCreateQRCode.CreateQRCodeClass.CreateQRCodeImage(RetailerId)
End Function
Here is the revised custom assembly.
public class CreateQRCodeClass
{
public static byte[] CreateQRCodeImage(string inputString)
{
QRCode4CS.QRCode qrcode = new QRCode4CS.QRCode(new QRCode4CS.Options(inputString));
qrcode.Make();
Image canvas = new Bitmap(86, 86);
[Code] ....
What data type can I successfully return to SSRS to display the image?
View 9 Replies
View Related
Jun 19, 2007
First of all, this is not in reference to using SRS (SQL Reporting Services) to render a report and then use one of the extensions to render the complete report as a pdf, tiff, excel etc. We have an opportunity to render a list of claims and then embed the supporting docs for each of the claims within the report. We don't have an issue referencing jpg and gif images via URLs and then rendering them within the report after the grid information. We do have an issue rendering tiff images within the report.
You can insert an image object into SRS at design time and have it render and you can convert a complete report to a tiff image but I cannot find a way to be able to render a tiff image when running the report. All you get is the red "x".
My question is has anyone encountered the same issue and, if so, what did you do to resolve the issue?
Thank you,
J Z
View 3 Replies
View Related
Feb 26, 2008
Hi,
I'm trying to do something rather weird, but I really need it. I'm trying to launch a SSIS package from a report
I built a custom assembly with one method that loads a package from file and then executes it. The assembly works fine.
I added the custom assembly to the report properties, instantiated the class in the assembly (the method is not static), called the method from the report (a textbox renders the string return value from the method).
I added the
Code Snippet[assembly: System.Security.AllowPartiallyTrustedCallers]
attribute to the AssemblyInfo.cs file
Created the strong name for the assembly.
Got the PublicKeyBlob with ILDASM, used it to add a new CodeGroup with the "StrongNameMembershipCondition" in the policy configuration files of ReportDesigner (RSPreviewPolicy.config), ReportServer (rssrvpolicy.config) and ReportManager (rsmgrpolicy.config).
Copied the dll in the bin folders of ReportServer and Visual Studio PrivateAssemblies.
I keep getting the awfull #Error message on the report when viewing it from ReportManager or ReportServer (in preview mode in VisualStudio all is well because security is not applied to user code).
I tried debugging:
- created a solution with two subprojects, one is the report, the other one is the assembly
- marked the report as the Startup Item
I get a SecurityException in debug and debuglocal modes when I try to instantiate a SSIS package.
Code SnippetPackage = new Package();
While digging in the exception call stack, it turns out I lack a permission for accessing unmanaged code (the source assembly of the exception is mscorlib). Also in the ouput window, while starting debugging i see a lot of SystemArgument exceptions in mscorlib.
I am perfectly aware that in order to be able to launch a SSIS package from code I referenced Microsoft.SqlServer.DtsRuntimeWrap.dll, so in desperation I added another CodeGroup in the aforementioned config files for this dll (StrongNameMembershipCondition) and copied the assembly in the deployment folders.
1: I would really like to know how to get the whole thing working. I find rather strange that even though I set the FullTrust
PermissionSet for my assembly (and the Microsoft.SqlServer.DtsRuntimeWrap assembly) I keep getting security exceptions.
While exploring the web for help I saw I need to assert all individual permissions for every restricted resource I'm accessing in the custom assembly, problem is I don't know exactly which ones I'm accessing and, being new to .NET security, I don't know how.
Surely I need to assert a file IO permission to load the package from file, a sqlclientpermission if I am accessing SqlServer in the package, and perhaps a unmanagedcode permission, given the the exception I described earlier (perhaps the Microsoft.SqlServer.DtsRuntimeWrap assembly is not managed code or is accessing some other unmanaged assembly).
Again, I wouldn't know how.
...and last
2: I tried modifying the assembly to only load a string from a file.. I had some problems with security but I got it working once, but I haven't figured out how exactly 'cause when fiddling around to understand things, I lost the working configuration. Really stupid, I know....
While testing this version of the assembly I followed an advice I found on some blog and restarted IIS and Reporting Services system service..
Is this always necessary after modifying the assembly source ? Do I need to restart every time both IIS AND Reporting Services
I would really appreciate every bit of help or advice anyone has to offer.
Thanks in advance.
View 6 Replies
View Related
Jan 22, 2008
Hello experts,
I need some help please.
Yesterday I get the answer that I had to use an assembly if I would like to use a function as global. Right now I€™m very desperate because my VS didn€™t recognize my DLL.
I get the error: "Could not load file or assembly .....The system cannot find the file specified."
After red the threads I tried to use gacutil.exe to add my assembly to the cache.
This action fails with the error:€? Failure adding Assembly to cache. Attempt to install an assembly without a strong name.€?
After that I tried to build a strong name through the follow execute:
Sn €“Vr ClassLibrary.dll. This action fails too. I get the follow Error description: €œdll does not represent a strongly named assembly€?.
What made me wrong?
Is there an easier workaround?
Have someone a good Idea could help me?
Hope to hear you soon.
Best regards,
Alex
View 4 Replies
View Related
Nov 27, 2007
Hi,
I was wanting to get some data through a custom assemly. I can successfully return a primitive data type such as a string and put it in a textbox, but I really need to return more data, and possibly bind it to a Table.
For example, maybe I could return from the call a Dataset and bind it as a DataSource which then can be bound to a Table, or maybe a array of string.
Is this possible? If so, are there any good examples that you know of?
Thanks,
AussieGuy
View 1 Replies
View Related
Apr 6, 2006
Hi there
I am trying to integrat a custom assembly into a ssis-package. I copy the assembly into the framwork folder (v2.0.50727) add the reference, use the assembly everything fine. When I try to debug I get a message stating that the assembly name, version .... cannot be found. I tried to do that with signing and without - not difference.
Am I missing something?
Please help
View 3 Replies
View Related
Oct 28, 2005
I've created C# assembly which was included into Script Task code as following:
View 10 Replies
View Related
Jan 7, 2008
When I add a custom assembly
I am trying to pass certain fields in dataset I am getting the following error
invalid fields i.e. that is fields that I passed are invalid.
It also says multi path identifier for microsft.reportingservices.reportobjectmodel.fieldimpl cud not be found.
Thanks
Sai
View 1 Replies
View Related
Oct 3, 2007
Hello Everyone,
When I run my report from report manager, I get the following error message
Failed to load expression host assembly. Details: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
My report uses a custom assembly. I have already done the following
1. copied the assembly in the "reportserverin" and the "common 7privateassemblies" area
2. Made the following entry in the rssrvpolicy.config
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="RSUtil.TranslationHelper"
Description="Translation Helper Utility">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:Program FilesMicrosoft SQL ServerMSSQL.5Reporting ServicesReportServerinAMOTest.dll"
/>
</CodeGroup>
3. Added the following line to my assemblyinfo.cs file
[assembly: AllowPartiallyTrustedCallers]
regards,
Abhishek.
View 9 Replies
View Related
Feb 28, 2008
I have developed a custom assembly to render a signature from an array of bytes in an SSRS Image control. The assembly works perfectly in the designer. It is strong-named and has the AllowPartiallyTrustedCallers attribute applied to it; I have deployed the assembly to the "%SQL SERVER%MSSQL.3Reporting ServicesReportServerin" folder; given it fulltrust permissions in the rssrvpolcy.config file; made sure that the NTFS file security is correct; and the assembly just doesn't appear to be called. The assembly doesn't execute when I use the "F5" popup preview mode on my development machine, either.
I don't get any error messages in the report, I just don't get any image output, either. The rest of the report elements render correctly. Of course, the SSRS log files are useless. Enabling the Verbose trace switch doesn't yield any useful information, I don't think, except that in the lines pertaining to running my signature-enabled report there are no mentions of even attempting to use my custom assembly.
I have attempted to enable object access auditing (both success and failure) to determine if my assembly is even being accessed by SSRS and there are no audit messages in the Security Event log.
Can anyone offer any other troubleshooting suggestions?
Thanks,
Matthew Belk
View 3 Replies
View Related
Mar 28, 2008
i deigned assembly and referced it to my report in preview
when deployed the report , i get #Error
i don't add any cas code.
pls help
View 4 Replies
View Related
Oct 8, 2015
I have build a vb.net class that uses the AxMetadataServiceClient (MS Dynamics Axapta model store) this class works like expected in .net app.When I try to create this assembly in sql it fails with this error
Msg 10300, Level 16, State 2, Line 6
Assembly 'System.EnterpriseServices' references assembly 'System.EnterpriseServices, version=4.0.0.0, culture=neutral, publickeytoken= b03f5f7f11 d50a3 a.', which is not present in the current database.
SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: version, culture or public key mismatch). Please load the referenced assembly into the current database and retry your request.can't create the assembly since it references it self and can't find it self ?
View 3 Replies
View Related
Mar 25, 2008
I have a custom assembly that I'm trying to use with my resport in Reporting Services in SQL Server 2008.
I keep consistently getting a "Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data,Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089' failed" error. Even in preview mode.
- I added <Assembly: AllowPartiallyTrustedCallers()> attribute to the assembly
- I'm asserting the permission in the routine that is doing the database call with the follwing lines:
Dim permission As SqlClient.SqlClientPermission = New SqlClient.SqlClientPermission(PermissionState.Unrestricted)
permission.Assert()
- I went in .net 2.0 Framework configuration and made the assembly fully trusted
- I added the approprtiate codegroup to the rssrvpolicy.config file
- I tried the same assembly on another PC running SQL server reporting services 2005, its working just fine.
what is it that I am missing?
View 1 Replies
View Related
Jan 7, 2008
Hi,
I use vs2005 and ssrs 2005.
I have an assembly like
namespace PackageCode
{
public static class Class1
{
public static string GetRequired(bool Split, string Id_StockItem, string InventoryUpdateQuery, string TotalRequired)
{
string outText = "";
return "Test"
...........
I did the
reportViewer.LocalReport.AddTrustedCodeModuleInCurrentAppDomain
(€?PackageCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d1c15bd232054a1€?);
part in my code.
I also added the
[assembly: System.Security.AllowPartiallyTrustedCallers]
too.
I published the assembly to GAC.
I added the dll as reference in rdlc file.
And I get this error when I try to enter this code under a textbox
=PackageCode.Class1.GetRequired(CBOOL(Fields!Split.Value),CSTR(Fields!StockItem),.....)
GetRequired is underlined with a red error line which says "unrecognized identifer" when I mouseover onto it.
And when I run the report I get #Error in that textbox.
I dont have a reporting server.I get the data from a dataset.
What to do now ?
Thanks for help.
View 4 Replies
View Related
Jan 10, 2007
Is it possible to have a Reporting Services dataset be returned from a custom assembly? I need to produce data for a graph that is not easily queried from the database and I am already familiar with using a custom assembly in an RS report.
What I would like to do is have a method that fills a dataset and returns it to the report for processing. Is this possible?
I am running SQL 2000 and RS 2000.
Thanks.
View 4 Replies
View Related
Sep 20, 2007
OK. I created a few functions in a Public Class called SSRSFunctions. I built it and deployed it to my desktop. What do I do now? Can it be included as standard functions in the function list within SSRS? Do I add a reference to the Class at the solution level? At the report level? If all I do is add a reference at the report level, I may as well add the functions to each report's code window, which is what I have been doing. I'd at least like to add a single reference to my solution if I can't get it added to the function list.
Thanks!
View 13 Replies
View Related
Jan 19, 2006
I have a custom assembly that i'm trying to get tied into my report. the problem is when i try to call it i get the error that the class is not defined
I have the class in the references tab and the class name and instance name both have a name.
here's the error I'm getting
Error 1 [rsCompilerErrorInClassInstanceDeclaration] Error in class instance declaration for class Assembly_1: [BC30002] Type '[ClassName]' is not defined. [Project folder][reportname].rdl 0 0
View 6 Replies
View Related
Feb 13, 2008
Good morning all,
Due to "security considerations", the company I am currently working with does not want me deploying custom assemblies into
Microsoft SQL ServerMSSQL.3Reporting ServicesReportServerin.
They have created a subdirectory:
Microsoft SQL ServerMSSQL.3Reporting ServicesReportServerinmySubDirectoryName
Unfortunately, I can't get my report to see the dll when it's in the subdirectory. Is there any way to do this?
Thanks,
Kathryn
View 1 Replies
View Related
Mar 29, 2008
I designed dll file to get data from sql server, i am calling the dll from ssrs 2005
in preview , everything is ok but after deploying and put the dll file in C:Program FilesMicrosoft SQL ServerMSSQL.3Reporting ServicesReportServerin and add this to rssrvpolicy.config
<CodeGroup
class="SqlClientPermission"
version="1"
Name="MySecurityExtensionCodeGroup"
Description="Code Group for Don's test security extension"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:Program FilesMicrosoft SQL ServerMSSQLReporting
ServicesReportServerinMyAssembly.dll"
/>
</CodeGroup>
i still get #Error
i try everything , i don't know what i can do.
pls help
View 1 Replies
View Related
Dec 20, 2007
Hello,
The main problem I am currently facing is that I do not have the following directory to place the DLL file: C:Program FilesMicrosoft SQL Server80ToolsReport Designer. It is the "Report Designer" part that is missing. I tried adding it, but that didn't work.
Any ideas why that is?
Thank you.
-Gumbatman
View 4 Replies
View Related
Sep 27, 2007
I'm having a terrible time trying to figure out how to do this, does anyone have experience?
My code works fine in the report viewer, but all I get from the deployment is #Error symbols. I've added my custom dll file to the config file and gave it full trust, as well as the URL of the web service I'm calling. I've even modified the rest of the codegroups within the file to FullTrust just in case.
I've also added the [assembly: AllowPartiallyTrustedCallers] to the AssemblyInfo class, and [WebPermission(SecurityAction.Assert)] to the constructor of my custom assembly no avail.
I'm at a complete loss now as to why my deployment cannot run this code. As far as debugging goes, Visual Studio is not located on the reporting server, nor is it an option to have it put there. I've been able to run the code with the web service lines commented out, but as soon as I put even the webservice.Credentials = CredentialCache.DefaultCredentials in I'm greeted with the nice and calming #Error.
Any suggestions?
View 1 Replies
View Related
Aug 10, 2007
We have a custom assembly that worked fine with SSRS 2000. Now that we have upgraded to SQL 2005 we get an "Access is denied" error when attempting to deploy reports that reference this assembly. I could swear that when we first attempted it it worked. We decided to make a minor change to the assembly code and that's when the problem started, even though I've since reverted back to the original code to make certain that the minor change wasn't the issue. The assembly is in the proper folder - C:Program FilesMicrosoft SQL ServerMSSQL.2Reporting ServicesReportServerin - and the reports are referencing the current version. I've searched high and low on the web for an answer but have found nothing even remotely helpful. All this code does is return a string...it's not doing anything that should require any additional security; and even then I doubt if there would be a problem when deploying.
The full text of the error is:
Error while loading code module: €˜Reporting, Version=1.0.2778.12272, Culture=neutral, PublicKeyToken=null€™. Details: Could not load file or assembly 'Reporting, Version=1.0.2778.12272, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.
Any ideas? Anyone? I'm at my wit's end on this!
Thanks,
Mike
View 5 Replies
View Related
Mar 7, 2006
Hi all,
my problem is that: I do read informations (e.g. connectionString) from configuration file by one custom assembly.
My environment is RS2005, VS.NET 2005 Prof.Edition, WIN2003 Server SP1, .NET Framework 2.0.50727
The scenario is that:
A text box into my report require a function contained into MyCustom.dll. This code do read information from MyCustom.dll.config.
This file contains:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="IS2009cfg" connectionString="data source=servernameinstancename;initial catalog=dbname;user id=xx;password=yy;" />
</connectionStrings>
<appSettings>
<add key="DefaultHeaderLogo" value="This is a test" />
</appSettings>
</configuration>
Using
ConnectionStringSettings conn = ConfigurationManager.ConnectionStrings["IS2009cfg"];
the result is null.
Also using
string defaultHeaderLogo = ConfigurationManager.AppSettings["DefaultHeaderLogo"];
the result is null.
MyCustom.dll and MyCustom.dll.config are located into locations of Report Server and Report Designer, with this Build Events on succesfully build:
rem Copy custom assembly to ReportDesigner location...
copy "...mydeveloplocation...inDebugMyCustom.dll" "C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMyCustom.dll"
copy "...mydeveloplocation...inDebugMyCustom.dll.config" "C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMyCustom.dll.config"
rem Copy custom assembly to ReportServer location...
copy "...mydeveloplocation...inDebugMyCustom.dll" "C:Program FilesMicrosoft SQL ServerMSSQL.4Reporting ServicesReportServerinMyCustom.dll"
copy "...mydeveloplocation...inDebugMyCustom.dll.config" "C:Program FilesMicrosoft SQL ServerMSSQL.4Reporting ServicesReportServerinMyCustom.dll.config"
The question is simple: where I do locate configuration file for obtain value during report execution?
Many thank's in advance
Claudio Barca
Turin - Italy
View 2 Replies
View Related
Mar 25, 2008
We use reporting services to report on our SQL 2005.
I wanted to have a function that translates a filter (parameter) in one RDL from IDs to Names to be able to show a summary of what the user selected when he executed the report.
Instead of writing this function in the .Code, I said great, lets use custom assemblies.
PROBLEM: I see examples on how to enable a function in such dll access to DB, but they all hardcode the connection string in the vb code. that seems useless to me. Each customer will have different server name, I need to get the connection string from the sme (shared data source) used in the catalog's folder. just like the RDl is using it. how do I do that?
View 1 Replies
View Related
May 5, 2008
I am extracting RS reports through a WebService:
report = execService.Render("EXCEL", null, out extension, out mimeType, out encoding, out warnings, out streamIds);
Some works fine but some are generating the following SoapException:
Error during processing of €˜ReportParameterTime€™ report parameter. ---> Error during processing of €˜ReportParameterTime€™ report parameter. ---> Error during processing of €˜ReportParameterTime€™ report parameter.
I set required parameters to their default values. In this specific report I have two required parameters:
1: ReportParameterTime, String
2: ReportParameter1, String
I set them to their default values (ReportParameterTime to "[Czas].[Kalendarzowy].[Rok].&[2007]" - means
Time Calendar Year 2007) but I am getting the exception above. I set parameters using this code:
execService.SetExecutionParameters(parameterValues.ToArray(), CultureInfo.CurrentCulture.Name);
Where parameterValues is a List<ReportExecution2005.ParameterValue>.
When I am using Microsoft.Reporting.WinForms.ReportViewer the report is generated without
any problems. I can see one parameter to choose: "Kalendarzowy" (means adj. Calendar) and can
select years, the default value is "2007".
What am I doing wrong and how can I fix this error ? Does anybody know ?
Regards,
Daniel
View 15 Replies
View Related
Apr 17, 2008
Hello,
I'm using Reporting Services to render a text (stored in sql as varchar(max)). The text is all plain text, with some lines having trailing spaces.
Source text file i've imported to SQL via SSIS:
CLIENT: 10055
STATEMENT 2007
DATE:1002993
THIS IS THE OTHER STATEMENT
COLUMN1 COLUMN2 COLUMN 3
TRY THIS
*Note the trailing spaces on the line before 'STATEMENT 2007'.
I've designed a report using the Report Project in VS2005 to retrieve this text via a stored procedure. When I test the report using the 'Preview' tab in the IDE, it looks good
CLIENT: 10055
STATEMENT 2007
DATE:1002993
THIS IS THE OTHER STATEMENT
COLUMN1 COLUMN2 COLUMN 3
TRY THIS
But when I deploy the report and run it using URL Access:
CLIENT: 10055
STATEMENT 2007
DATE:1002993
THIS IS THE OTHER STATEMENT
COLUMN1 COLUMN2 COLUMN 3
TRY THIS
On all lines with trailing spaces, they (the trailing spaces) have been removed. This is affecting my formatting of some reports and statements. We really want to use the report viewer as it has built in paging, print and export capabilities.
Why does it look okay in VS2005 but different in Report Viewer via URL Access and Report Manager?
Note: When I export as PDF, it looks okay.
The stored procedure I use to return the data is a CLR Hosted assembly as below:
Code Snippet
Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub GetPagedDocument(ByVal inText As SqlString)
Dim dr As SqlDataReader
Dim row As New SqlDataRecord(New SqlMetaData("RowText", SqlDbType.Text))
Dim cmd As New SqlCommand("select cast(doc as varchar(max)) as 'DOCTEXT' from testdoc WHERE id='" + inText + "'")
Dim cn As New SqlConnection("context connection=true")
cn.Open()
cmd.Connection = cn
SqlContext.Pipe.SendResultsStart(row) 'initialise the resultset to be returned
dr = cmd.ExecuteReader
'If no records in result set, return.
If Not dr.HasRows Then
row.SetString(0, "There is no document to display or you do not have permission to view the document.")
SqlContext.Pipe.SendResultsRow(row)
SqlContext.Pipe.SendResultsEnd()
' SqlContext.Pipe.Send("There is no document to display.")
Return
End If
'Read rows in the result set
dr.Read()
'Get the entire text
Dim docText As String = dr.Item("DOCTEXT")
'debug
row.SetString(0, docText)
SqlContext.Pipe.SendResultsRow(row)
SqlContext.Pipe.SendResultsEnd()
Return
'end debug
End Sub
End Class
Any help will be appreciated.
View 3 Replies
View Related
Apr 7, 2008
I have a custom assembly that uses a config file to obtain database connection settings. This dll is then used by my sql report. I have added refrerenced to all the required dll's in my report and added the required code groups to all the necessary files. I have also placed my app.config file in C:Program FilesMicrosoft SQL ServerMSSQL.3Reporting ServicesReportServer and C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssemblies
However when I actually run the report in the designer (vs2005) I am receiving Null reference exceptions when my code tries to read my config file because it is reading the machine.config file and not my app.config file. If I hard code my connection string everything works fine.
Can anyone tell me why the machine.config file would be referenced instead of my app.config file and how I can stop it from doing this?
View 6 Replies
View Related
Mar 7, 2007
Hi there.
I have an assembly, call it A1, that I've deployed to a SQL Server 2005 database. I can use the managed stored procedures from A1 in SQL Server no problem.
In A1 there is a bit of code which uses the Assembly.Load() method, so load another assembly and use instances of class found in that external assembly. However, when I run the managed stored proc in A1 that uses Assembly.Load() I get the error:
Could not load file or assembly 'A1, Version=1.0.0.0, Culture=neutral,PublicKeyToken='????' or one of its dependencies. The system cannot find the file specified.
(note: for security I've changed some of the above line).
So I changed the Assembly.Load() to use
System.Data,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089
I re-built the project, re-deployed it and ran the code in SQL Server - it worked. I could create an instance of a System.Data.DataSet for example. So why can't I load my own custom assembly? My assembly does have a strong name and it's installed in the GAC. I wrote a console app to try and Assembly.Load() my custom assembly and that worked fine (it was also running on the same server as the SQL Server).
So it's defiantely the SQL Server that can't 'see' my customer assembly. What do I need to do this assembly so that SQL Server will allow me to Assembly.Load it, just as it can with System.Data?
Thanks
Jas.
View 1 Replies
View Related
May 22, 2007
.NET Permissions Error in Reporting Services when not using a custom assembly:
I need help resolving a permissions error I€™m taking in a SQL RS 2005 report.
I have a report that that is includes the following code fragment in Report Properties -> Code:
Function rtf2text(ByVal rtf As String) As String
Dim rtfcontrol As New System.Windows.Forms.RichTextBox
Try
rtfcontrol.Rtf = rtf
Return rtfcontrol.Text
Catch ex as Exception
Return ex.Message
End Try
End Function
I reference the .NET System.Windows.Forms DLL under Report Properties -> References -> References, Assembly Name (heading):
System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
I have a text box with the following expression:
=code.rtf2text(First(Fields!EndingQuoteComment.Value, "QuoteHeader"))
And I€™ve verified, by removing the code.rtf2text command that is populated with the following:
{
tf1ansiansicpg1252deff0deflang1033{fonttbl{f0fromanfprq2fcharset0 Times New Roman;}{f1fnilfcharset0 Arial;}} viewkind4uc1pardif0fs32 ** Ending Quote Comments **par 0i0f1fs17par }
When I run the preview in Visual Studio is correctly strips the RTF and displays just €œ** Ending Quote Comments **€?. When I €˜RUN€™ locally or deploy to a SQL RS 2005 Server and run the report I take the following error:
Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I€™ve tried everything that I can think of on the server to make this work.
I finally put together a Win 2003 box with SQL 2005, IIS, and RS 2005 running on it in a virtual machine to be 100% sure I had a standard clean install and deployed the report and I€™m getting the same error.
Below I€™ve included a basic standalone RDL file that demonstrates my issue. I get the error referenced above when I deploy the RDL below. Any ideas or suggestions are greatly appreciated?
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<BottomMargin>0.25in</BottomMargin>
<RightMargin>0.25in</RightMargin>
<PageWidth>7.75in</PageWidth>
<rdrawGrid>true</rdrawGrid>
<InteractiveWidth>7.75in</InteractiveWidth>
<rdnapToGrid>true</rdnapToGrid>
<Body>
<ReportItems>
<Textbox Name="textbox21">
<Left>0.25in</Left>
<Top>0.25in</Top>
<rdefaultName>textbox21</rdefaultName>
<Width>6.375in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontSize>7.5pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>1.375in</Height>
<Value>=code.rtf2text("{
tf1ansiansicpg1252deff0deflang1033{fonttbl{f0fromanfprq2fcharset0 Times New Roman;}{f1fnilfcharset0 Arial;}} viewkind4uc1pardif0fs32 ** Ending Quote Comments **par 0i0f1fs17par } ")</Value>
</Textbox>
</ReportItems>
<Height>5.25in</Height>
</Body>
<rd:ReportID>8804486c-882f-493c-8dfb-b2f778a24b21</rd:ReportID>
<LeftMargin>0.25in</LeftMargin>
<CodeModules>
<CodeModule>System.Windows.Forms, Version=2.0.50727.42, Culture=neutral, PublicKeyToken=b77a5c561934e089</CodeModule>
</CodeModules>
<Code>Function rtf2text(ByVal rtf As String) As String
Dim rtfcontrol As New System.Windows.Forms.RichTextBox
Try
rtfcontrol.Rtf = rtf
Return rtfcontrol.Text
Catch ex as Exception
Return ex.Message
End Try
End Function </Code>
<Width>7.25in</Width>
<InteractiveHeight>10in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>0.25in</TopMargin>
<PageHeight>10in</PageHeight>
</Report>
View 2 Replies
View Related