views:

91

answers:

1

Hi,

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 report. But user should have date and time of their PC. because that time is basically a report generates date time.

Please help me?

A: 

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 :)

Tikeb
Thanks,Can you write some code, so that it will easy for me to understand better. Actually i am new in crystal report
Hemant Kothiyal
I've edited what I know - hope this helps..
Tikeb
I take it, it did not..
Tikeb
I think you should forward datetime to server somehow - using POST parameters and javascript for example.
Arvo