开发者

How it is possible to print client side(browser) datetime in crystal report?

In asp.net website, i am using crystal report. My question is very generic i.e. How it is possible to display client side (browser) date and time?

Actually in my case our website is going to hosted at India, while that site is used by user's at SWEDEN.

Now the problem is that when user request for report then it is displaying server side date time because i have used PRINTTIME control of crystal re开发者_如何学编程port. But user should have date and time of their PC. because that time is basically a report generates date time.

Please help me?


When you call the report you could pass the users datetime as a parameter?

In the Field Explorer in Crystal you can add the DateTime parameter to your report. I only know how to call the report through c# but I guess it can't be too different.

Using the crystal decisions engines in my project I add them like so:

CrystalDecisions.CrystalReports.Engine.ReportDocument myDataReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
myDataReport.Load(@"C:\ReportLayouts\YourReportHere.rpt");
myDataReport.SetDataSource(dtGraph); // Your data table/data set here..
myDataReport.Refresh();

// Here is where you pass the parameter..
myDataReport.SetParameterValue("YourParameterNameInReport", DateTime.Now);

Stream msPDFGraph = myDataReport.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
myDataReport.Close();

return msPDFGraph;

Hope this helps :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜