Page 1 of 2

Loading reports from Stimulsoft Reports.Server

Posted: Wed Mar 23, 2016 9:29 am
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();

Re: Loading reports from Stimulsoft Reports.Server

Posted: Wed Mar 23, 2016 11:23 am
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.

Re: Loading reports from Stimulsoft Reports.Server

Posted: Wed Mar 23, 2016 12:18 pm
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.

Re: Loading reports from Stimulsoft Reports.Server

Posted: Wed Mar 23, 2016 12:39 pm
by Alex K.
Hello,

Thank you for your suggestion.
We will add them to the download page on our site.

Re: Loading reports from Stimulsoft Reports.Server

Posted: Wed Mar 23, 2016 1:40 pm
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.

Re: Loading reports from Stimulsoft Reports.Server

Posted: Wed Mar 23, 2016 5:40 pm
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.

Re: Loading reports from Stimulsoft Reports.Server

Posted: Wed Mar 23, 2016 5:57 pm
by JNieto
Thank you! I hope you also publish it as a NuGet package for convenience of the developers.

Re: Loading reports from Stimulsoft Reports.Server

Posted: Thu Mar 24, 2016 11:57 am
by Alex K.
Hello,

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

Thank you.

Re: Loading reports from Stimulsoft Reports.Server

Posted: Tue Mar 29, 2016 2:00 pm
by JNieto
Thank you!! It's great news! By the way, is it available for .NET 3.5?

Re: Loading reports from Stimulsoft Reports.Server

Posted: Tue Mar 29, 2016 2:04 pm
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.