How to generate a standalone report from an C# WPF web application?

1 Answer 32 Views
.NET Framework DataSource JSON General Discussions Report Designer (standalone) Report Parameters Report Viewer - WPF
John
Top achievements
Rank 1
John asked on 05 Apr 2024, 01:30 PM | edited on 10 Apr 2024, 04:39 AM

Hi,

 

We have a requirement to create a report using the "Standalone Report Designer". We just want to open the standalone reporting tool from our desktop application at a button click and allow user to create their own reports. For that we have to pass the content of the report from the desktop application to the standalone tool. We tried to pass the argument in "Process.Start" Method. But we got an error message as in the attached image. 

Could you please help us to work on the standalone Report Designer tool with  C# WPF desktop application?

We want to know how the below items will be work.
1) How to open the standalone report designer programmatically (C#)?
2) How to pass the content from C# to the tool?

Thank You !

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 10 Apr 2024, 09:00 AM

Hello John,

Thank you for the attached screenshot and the additional information!

I would also recommend using the ProcessStartInfo Class to start the ReportDesigner executable programmatically. However, passing content to the report designer from outside is not possible.

Could you please elaborate further on what type of content you need to pass to the report designer? Is it data or something else? 

If it is data, you may programmatically create a report where that data is embedded in the report definition via the data source components - Modify the Report Data Sources through code - Telerik Reporting. The following articles should give you an idea of how to programmatically create reports:

However, the Standalone Report Designer can open only TRDP/TRDX report definitions so the reports created from code would need to be packaged into TRDP/TRDX files and saved on the file system - Packaging Report Definitions Explained - Telerik Reporting.

With that being said, the user would still need to manually open the created report as the Report Designer exe does not have start-up parameters for which report to open so it is not possible to configure it from the command prompt. We haven't had such a scenario before so if that is something that would be useful to you, please feel free to request it on the feedback portal - ProgressĀ® TelerikĀ® Reporting Feedback Portal.

Please let me know if I can help with anything else or if you have any additional questions.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
John
Top achievements
Rank 1
commented on 11 Apr 2024, 10:45 AM

Hi,

"Could you please elaborate further on what type of content you need to pass to the report designer? Is it data or something else? "

Yes, we are passing data to the report designer. And we are following your suggested articles for the implementation. If we need any help we will ask the  questions here.

Thanks!

John
Top achievements
Rank 1
commented on 17 Apr 2024, 12:58 PM

Hi,

We followed the following steps to test how to programmatically open a .trdp file from the desktop application:

1) We created a .trdp file using the standalone designer tool
2) By using the ProcessStartInfo class to programmatically start the Standalone Report Designer, we have included a screenshot of the code below.

We are able to view the standalone reporting tool, but it is displaying an error "unsupported file format". We included the screenshot for your reference.

When we tried to open the same file with command prompt, we are able to see the file in standalone reporting tool without any issues. We used the below command to open the file:
start "Telerik Report Designer" "C:\Program Files (x86)\Progress\Telerik Reporting 2024 Q1\Report Designer\Telerik.ReportDesigner.exe" "C:\JamesDevelopment\R\TRDP files\SampleReport.trdp"

Can you please guide us on how to programmatically open the file from the desktop application? 

Thank you !

Lance | Senior Manager Technical Support
Telerik team
commented on 17 Apr 2024, 07:10 PM

Hi John, thank you for sharing the error message. If you look closely, you'll see it is failing because of the space in the file path.

You must account for this whitespace when using Process.Start's arguments.

There are many discussions that talk about this, here's one => https://stackoverflow.com/a/6521650/1406210. You might also be able to use a helper method mentioned in that thread, try something like this:

using System.Diagnostics;

Console.WriteLine("Starting Desktop Designer");

var applicationPath = @"C:\Program Files (x86)\Progress\Telerik Reporting 2024 Q1\Report Designer\Telerik.ReportDesigner.exe";
var filePath = @"C:\JamesDevelopment\R\TRDP files\SampleReport.trdp";

var process = new Process();
process.StartInfo.FileName = applicationPath;
process.StartInfo.Arguments = AddQuotesIfRequired(filePath);
process.Start();

string AddQuotesIfRequired(string path)
{
    return !string.IsNullOrWhiteSpace(path) 
        ? path.Contains(" ") && (!path.StartsWith("\"") && !path.EndsWith("\"")) ? "\"" + path + "\"" : path 
        : string.Empty;
}

John
Top achievements
Rank 1
commented on 18 Apr 2024, 08:43 AM

Hi Lance ,

Thanks for your reply. Now, we are able to see the .trdp file using standalone reporting tool without any issues.
If we need any help we will ask the  questions here.

Thanks !

John
Top achievements
Rank 1
commented on 29 Apr 2024, 09:48 AM

Hi Lance,

Can we open a .rpt file using standalone tool? If not possible, Is there any other way to open the .rpt file?
Lance | Senior Manager Technical Support
Telerik team
commented on 29 Apr 2024, 01:59 PM

Hi John,  '.rpt' files are not from Telerik, it is a Crystal report, and is not compatible with our designers, frameworks, or rendering systems.

If you want to use our tooling for it, you would first need to convert it for a Crystal Report to a Telerik Report, then you can move forward using our modern features and tooling (after conversion, it becomes a .trdp or .trdx file).

Here are the documentation articles related to import/conversion:

If you have any questions about importing or have trouble, please open a new support ticket so the team can assist => https://www.telerik.com/account/support-center/contact-us (select "Technical Support").

John
Top achievements
Rank 1
commented on 30 Apr 2024, 10:06 AM

Hi Lance,

From the documentation, we understood that we have a Telerik converter to convert the crystal reports to telerik report. Is there any option to programmatically convert the crystal reports to telerik reports without using the telerik converter tool?

Lance | Senior Manager Technical Support
Telerik team
commented on 30 Apr 2024, 12:50 PM

Hi John, the converter tooling is not a .NET runtime API that you would place inside your project for "on-the-fly" conversations. The report needs to be converted using with either:

  • Visual Studio extensions' Wizard
  • Telerik Standalone Report Designer's Wizard

The conversion process is complicated and some Crystal elements may not have a 1:1 companion in Telerik Reporting, please see the yellow note here => Importing Reports at a glance - Telerik Reporting

 

John
Top achievements
Rank 1
commented on 03 May 2024, 05:15 AM | edited

Hi Lance,

Thanks for your reply. We converted the .rpt file to .trdp file using Telerik Standalone Report Wizard. The result is as in the screenshot.

But the data is not visible in the report. We are not sure about the reason. Can you help us on the below questions?

1) In our case, we have a table in the database with 3 columns it includes a binary datatype also. Whether this cause the data displaying issue?

2) If so, then to which format we have to convert the binary data?

3) Is the data display issue caused by the trial expiration?

Lance | Senior Manager Technical Support
Telerik team
commented on 03 May 2024, 02:10 PM

Hi John,

Let me answer #3 first; no, we do not have any logic bombs that disable functionality after a trial expires.

For #1/2, this looks like an issue with the data itself or conversion of the data. I would recommend that you open a new forum thread to ask about the using binary data column values. Once I see it come in, I'll be sure to assign it to someone who can help.

 

John
Top achievements
Rank 1
commented on 03 May 2024, 02:35 PM

Hello Lance, I have created a new thread here:

https://www.telerik.com/forums/issue-converting-rpt-file-to-trdp-file-using-telerik-standalone-report-wizard

Lance | Senior Manager Technical Support
Telerik team
commented on 03 May 2024, 04:56 PM

Thanks for following up with the link. Someone from the Reporting team will follow up with you there.
Tags
.NET Framework DataSource JSON General Discussions Report Designer (standalone) Report Parameters Report Viewer - WPF
Asked by
John
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or