How to call Jasper Report from C# .net windows application

0

Hi,

I am new to Jasper Report and was using Crystal Report earlier. I want to ask can anyone share a c# class file which shows how to call a Jasper Report from C# application which is deployed in Jasper Report Server.

Also is there any cloud based Jasper Report server where some sample Jasper Report are deployed which can be used for testing purpose using one's C# code?

Any input wil be deeply appreciated.

Regards,

Abhishek. 

abhishekpathak.zcst's picture
Joined: Dec 13 2013 - 12:17am
Last seen: 5 years 4 months ago

1 Answer:

0
Hi All,
 
I was able to run report successfully  from c# Rest webservice . 
I took help from this blog http://www.freeze.ro/node/7 . This blog doesnt shows anything about passing parameters.
So. I figured it on my own.
Let know if anyone needs it. It was quite simple. 
 
 
Regards,
Abhishek
abhishekpathak.zcst's picture
Joined: Dec 13 2013 - 12:17am
Last seen: 5 years 4 months ago

can you please post the parameters, i didn't hnow how to change it ! thanks

anas.benseddik - 5 years 4 months ago

There is separate class for the same such as IntJasperReportParameter, StringJasperReportParameter. Assign value and Name to it and pass as a list of JasperReportP"arameters. It will be done

abhishekpathak.zcst - 5 years 4 months ago

JrParameterItem mp3 = new JrParameterItem();
mp3.Name = "Au";
mp3.Value = "01-01-2015";
mP.Add(mp3);

IntJasperReportParameter p = new IntJasperReportParameter();
p.IntValue = 2;
p.Name = "NN";
mP.Add(p);

DateTimeJasperReportParameter d = new DateTimeJasperReportParameter();
d.DateTimeValue = DateTime.Now.Date;
d.Name = "Du";
mP.Add(d);

JasperReport report = new JasperReport()
{
Name = "Relevé",
Path = "/Pathto/MyReport",
Parameters = mP,

};
@aelhadi

aelhadi - 5 years 3 months ago
Feedback