Telerik ReportViewer Q2 2014 - c#

I am trying to learn how to use the Telerik Reporting dll and i cannot find a single solid example that explains setup from start to finish for wanting to render a report that is located on an ssrs server. I am trying to set it up just like the normal windows reportviewer control( i know they're not the same). I have researched trying to set the server, report path, credentials, and so forth to simply connect and find the report to render but there is not one damn example...Can someone please share the secret to get this method working? The below code worked perfectly with the windows reportviewer control but i can't find an example for the telerik one that comes close to these properties for setup.
ServerReport serverReport = rvMain.ServerReport;
//User Credentials
System.Net.ICredentials credentials = System.Net.CredentialCache.DefaultCredentials;
ReportServerCredentials rptServerCrecentials = serverReport.ReportServerCredentials;
rptServerCrecentials.NetworkCredentials = credentials;
serverReport.ReportServerUrl = new Uri(report.ReportServer);
serverReport.ReportPath = report.ReportPath;
//EnableExportFormats(report.ExportTypes);
//Render the report
rvMain.RefreshReport();

Telerik Reporting does not support opening SSRS reports - this is the reason why you are having troubles. It can only open reports created with the Telerik report designers.
Cheers.

Related

Crystal Report generates on dev box, but not web server

I have a CrystalReportViewer control on an ASPX page. On my development machine the Crystal Report generates properly. However, when I publish it and run it on a web server I get the following pop-up screen. Entering in the password does nothing. The same screen just pops up again:
The datasource is configured in the .rpt file. So my code on the CrystalReportViewer is simply the following:
if (Request.QueryString["report"].ToString() != "")
{
ReportDocument doc = new ReportDocument();
doc.Load(Request.QueryString["report"].ToString());
CrystalReportViewer1.ReportSource = doc;
}
If it helps, some of the (more important looking) datasource properties in the .rpt file are as follows:
Database Type: ODBC (RDO)
DSN: plmprod
Server Type: ODBC - plmprod
Use DSN Default Properties: True
Also, I have the same ODBC/System DSN (named plmprod) setup on my development machine and on the web server. Using the "Test Connection" option they both test successfully.
I am not sure how to troubleshoot this issue. Nor do I know much about Crystal Reports.
What could be the problem that is causing the report to not generate on the web server?
I created a 64 bit ODBC/DSN on the web server and it now works!
All of my Crystal Reports Windows apps work fine around the company with 32 bit DSNs so I made a false assumption that is what the web server would want as well...not so as I found out.

No Printers are installed issue with crystal report PrintToPrinter

I had recently upgraded the Crystal report runtime version from 13.0.1 to 13.0.8 to use the new feature of HTML interpretation of text.
I have the logic of printing crystal report as part of a WCF Service.
But we are now facing issues while we try to Print the report directly on a network printer using report.PrintToPrinter method saying printer not installed even though it was still installed and working.
when i tried to execute report.ExportToDisk method its sucesfully exporting it as a pdf file on to hard drive with new version 13.0.8
But when rolled back to an older version on CR runtime it started working fine.
Any clues on wat exactly could have caused the issue?
Thanks
In the application pool, set
Process Model Load User Profile: True
To avoid having the domain account or the user that setup the printers logged in.
I had a similar problem where a call to PrintToPrinter was working in development but failing in other environments. After tremendous heartache, I discovered that changing the PrintToPrinter call solved the problem. Hopefully this info will help others in the future.
This post from SAP forums lead me in the right direction:
https://answers.sap.com/questions/12380707/no-printers-are-installed---printtoprinter-problem.html
Changing from this:
crystalReport.PrintOptions.PrinterName = "\\\\print_server\\printer";
crystalReport.PrintToPrinter(1, true, 0, 0);
to this:
System.Drawing.Printing.PrinterSettings printersettings = new System.Drawing.Printing.PrinterSettings();
printersettings.PrinterName = PrinterToUse;
printersettings.Copies = 1;
printersettings.Collate = false;
Report.PrintToPrinter(printersettings, new System.Drawing.Printing.PageSettings(), false);

Crystal Reports for VS2010

I'm having some issues getting crystal reports working nicely with our applications. And i cannot seem to find any resources that answer my question.
Basically, we have a crystal report, designed in the crystal reports application with it's own datasource.
Now when i add this to VS and display it, i need to setup a connection on the PC using MYSQL ODBC Datasource configuration tool, however even with this datasource setup, the crystalreports viewer askes for a password, and even suppling the correct password will show a "login failed. please try again" error message.
Ideally what i would like to know, is
A) is it possible and if so how, can i setup the connection in VS2010 so that i wont need to go around using MYSQL ODBC Datasource configuration tool on every PC i deploy my application too.
B) why does this connection always fail, the credentials are correct (we've tested multiple times, and the report & connection function perfectly from within crystal reports)
Hopefully you guys can help me out, my google fu has failed me.
If the Crystal Report allows for the username and password to the mySQL stored procedure to be passed to the report through the ReportViewer object, you have to use .NET code-behind to set the credentials via the:
ReportViewer.ServerReport.ReportServerCredentials
property of the ReportViewer instance.
Here's an example:
System.Net.NetworkCredential networkCredentials =
new System.Net.NetworkCredential("username", "password", "domain");
reportViewer.ServerReport.ReportServerCredentials = networkCredentials;

Getting the ssrs webservice from any given url?

So I can't reference any specific SSRS web service with my project because I want users to be able to point it to their own report server. Is there any way for me to do this?
Specifically I'm going to need to be able to (at least) get the available reports, view reports, and schedule reporting. I haven't touched report scheduling via c# yet, but report selection/viewing is simple enough with a reference to my local reporting service. Is there any way to dynamically load the web service for any given reporting service--assuming I know the url or the server and instance name?
var rs = new ReportingService2005
{
Credentials = System.Net.CredentialCache.DefaultCredentials
};
// get catalog items from the report server database
CatalogItem[] items = rs.ListChildren("/", true);
// add each report to the combobox
foreach (CatalogItem ci in items)
{
if (ci.Type == ItemTypeEnum.Report)
comboBox1.Items.Add(ci.Path);
}
This is what I'm currently doing to pull out the available reports. But, as mentioned, above, it is directly referencing my own report server. ReportingService2005 (what I named the reference to my .asmx web service) is what I would like to be able to dynamically load.
Definitely possible. ReportingServices have .Url property you can assign. So you can do:
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
rs.Url = "http://<Server Name>/reportserver/ReportService2005.asmx";
Reference: "Setting the Url Property of the Web Service"

Crystal Reports (VS 2010) report not showing up and not throwing any errors

I'm trying to get a Crystal Report to show up on a web page. My code looks like this:
ReportDocument rd = new ReportDocument();
rd.Load(#"C:\projects\reports\testreport.rpt");
rd.SetDatabaseLogon("sa", "thepassword");
CRViewer.ReportSource = rd;
I've worked through several actual errors already to get to where I am now. The last error I had was that the connection couldn't be made, but when I added the SetDabaseLogon call to use SQL Server Auth security instead of integrated that problem was fixed.
Now I am not getting any error at all but the report simply doesn't show up.
I'm at a loss as to what to try now, any ideas would be appreciated!
(I don't know if this is really relevant or not, but this is in a SharePoint web part that I'm creating.)
Try adding this line:
CRViewer.Show();
If it isn't that simple, then I'd run the application outside of the webpart wrapping to at least confirm/deny if it being in SharePoint is related.

Categories