Loading reports from Stimulsoft Reports.Server

Stimulsoft Reports.NET discussion
JNieto
Posts: 8
Joined: Wed Mar 23, 2016 9:23 am

Loading reports from Stimulsoft Reports.Server

Post by JNieto »

Hello.

We're evaluating your products. We have configured a Stimulsoft Reports.Server in one machine so our customers can edit reports online. At the same time, we would like to load those reports (hosted in the server) using an application in .NET (WPF) as PDF.

We've looked along all your website, but the only code that we found was the one below. The problem is the classes it uses aren't found in any of the assemblies that come in your .NET / WPF trials.

Please, tell me how to connect and retrieve reports as PDF from your Reports.Server instance.

Thank you.

// Connect to Stimulsoft Report Server on port 40010
var connection = new StiServerConnection("http://localhost:40010/");
// User Name and Password from actions
connection.Users.Login("username", "password");

// Load Data in ByteArray
var bytes = File.ReadAllBytes("Data.xml");

// Get Item from Access Key
var dataItem = connection.Items.Get("94ebe81e880843fb899eee393397f092") as StiFileItem;
// Create Item if it does not exist
if (dataItem == null) dataItem = connection.Items.Root.NewFile("data.xml", StiFileType.Xml);
// Upload Data to Item
fileItem.UploadFromArray(bytes);

// Get PDF Item from Access Key
var pdfItem = connection.Items.Get("b17ce23f44ee411793440bceb61d4ba6") as StiFileItem;
// Create Item if it does not exist
if (pdfItem == null) pdfItem = connection.Items.Root.NewFile("report.pdf", StiFileType.Pdf);
fileItemPdf.Save();

// Get Report from Access key
var reportItem = connection.Items.Get("4cf1d78e5773470880b0145f895c7f00") as StiReportTemplateItem;
// Create Item if it does not exist
if (reportItem == null) reportItem = connection.Items.Root.NewFile("report", StiFileType.ReportSnapshot);
// Compile Report to PDF Item
reportItem.Run(pdfItem);

// Download PDF to ByteArray
var result = fileItemPdf.DownloadToArray();

// Logout User
connection.Users.Logout();
Last edited by JNieto on Wed Mar 23, 2016 5:59 pm, edited 1 time in total.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Loading reports from Stimulsoft Reports.Server

Post by Alex K. »

Hello,

You can found the necessary assemblies on the server at the following path:
c:\ProgramData\Stimulsoft-Server\Software-Releases\[Version]\

Thank you.
JNieto
Posts: 8
Joined: Wed Mar 23, 2016 9:23 am

Re: Loading reports from Stimulsoft Reports.Server

Post by JNieto »

Thanks! Is there any link to download those files without having to access the server's filesystem? For convenience, I think it should be a separate download, since all clients would need the assemblies to communicate with the server.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Loading reports from Stimulsoft Reports.Server

Post by Alex K. »

Hello,

Thank you for your suggestion.
We will add them to the download page on our site.
JNieto
Posts: 8
Joined: Wed Mar 23, 2016 9:23 am

Re: Loading reports from Stimulsoft Reports.Server

Post by JNieto »

Thank you! It will be very handy. Are you posting it today or is a planned task to prioritize? Is to know whether to wait for it or ask out manager to provide access to the server folder with the files.
Last edited by JNieto on Wed Mar 23, 2016 6:03 pm, edited 1 time in total.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Re: Loading reports from Stimulsoft Reports.Server

Post by Jan »

Hello,

Sorry for misunderstanding!

You can find required files here:
Connect.zip
(3.93 MiB) Downloaded 434 times
Let me know if you need anything also.

Thank you.
JNieto
Posts: 8
Joined: Wed Mar 23, 2016 9:23 am

Re: Loading reports from Stimulsoft Reports.Server

Post by JNieto »

Thank you! I hope you also publish it as a NuGet package for convenience of the developers.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Loading reports from Stimulsoft Reports.Server

Post by Alex K. »

Hello,

We have published package on the NuGet:
https://www.nuget.org/packages/Stimulso ... nnect_API/

Thank you.
JNieto
Posts: 8
Joined: Wed Mar 23, 2016 9:23 am

Re: Loading reports from Stimulsoft Reports.Server

Post by JNieto »

Thank you!! It's great news! By the way, is it available for .NET 3.5?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Loading reports from Stimulsoft Reports.Server

Post by HighAley »

Hello.

Sorry, but all our product support .Net Framework 4.0 and above.
The .Net Framework 3.5 is not supported.

Thank you.
Post Reply