This is a migrated thread and some comments may be shown as answers.

Setting maximum and Minimum datetime

7 Answers 190 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 01 Jul 2014, 03:17 PM
I would like to set the Maximum and Minimum values for the DateTime axis for my graph from my datasource. 

For example i want to display from 01/01/2014  to 02/01/2014.  I currently have those two values in parameters, but how do i set the Maximum and Minimum of the scale to these paramaters?  I have tried =Parameters.Start.Value ect... (Start is my datetime parameter)

Any suggestions?

7 Answers, 1 is accepted

Sort by
0
Craig
Top achievements
Rank 1
answered on 03 Jul 2014, 07:12 PM
I have tried out many different ways to approach this, I have been succesffully able to change the maximum and minimum properties through changing the xml attributes of the report dynamically through javascript/c#.  I feel as if there has to be a simplier and more efficient way to change the max and min values on the axis.

thanks
0
Nasko
Telerik team
answered on 04 Jul 2014, 10:47 AM
Hello Craig,

The Scale.Minimum and Scale.Maximum properties of the Graph Axis do not support expressions. You can set static values for these properties, but cannot assign report parameter values.

A possible approach, as you mentioned, is to determine these values and set them programmatically in the report definition before the report is displayed in the viewer.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Craig
Top achievements
Rank 1
answered on 07 Jul 2014, 01:20 PM
Hello Nasko,

Thank you for the quick and timely post.  Unfortunately I have discovered that if multiple customers are using the same template and changing the xml properties at different times that there may be a time that two customers open the report up and save it at different times.  This could mess up the scaling for them.

I came up with another ideal, maybe adding fake events to the maximum and minimum dates so the graph stretches out.  Do you think this is possible?  

Thanks
0
Nasko
Telerik team
answered on 10 Jul 2014, 08:12 AM
Hello Craig,

We believe the best approach would be to send us a small runnable sample project with dummy data, which demonstrates a similar scenario. We will review it and try to implement a solution to set the required scale minimum and maximum.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Carl
Top achievements
Rank 1
answered on 24 Oct 2017, 01:53 PM

How do I access the Maximum and Minimum values for the DateTime axis (programming language is C#)?

I'm using the ReportProcessor to print the report programmatically and would like to set the values before I print the report. My report contains a singe graph object (graph1). The name of the coordinate system is the standard (cartesianCoordinateSystem1)

Code part used for printing (report definition attached):

 {
printerSettings.PrinterName = curveSheetRequests.printer_name;
printerSettings.DefaultPageSettings.Landscape = false;
printerSettings.DefaultPageSettings.Color = true;

Report testReport = new ReportLibrary1.Report1();

InstanceReportSource instanceReportSource = new InstanceReportSource();
instanceReportSource.ReportDocument = testReport;

testReport.ReportParameters["pFromDate"].Value = DateTime.Parse(curveSheetRequests.operation_start);
testReport.ReportParameters["pToDate"].Value = DateTime.Parse(curveSheetRequests.operation_end);
testReport.ReportParameters["pSheetSpecXML"].Value = curveSheetRequests.curvesheetxmlstring;
testReport.ReportParameters["pHeaderFooterXML"].Value = curveSheetRequests.headerfooterxmlstring;

Telerik.Reporting.Processing.ReportProcessor reportEngine = new Telerik.Reporting.Processing.ReportProcessor();
reportEngine.PrintController = printController;

reportEngine.PrintReport(instanceReportSource, printerSettings);
}                            

0
Nasko
Telerik team
answered on 24 Oct 2017, 02:26 PM
Hello Carl,

The Minimum and Maximum properties support Bindings, so you can set their values dynamically based on data or report parameters. You need to open the Bindings property editor of the coordinate system in order to do that.

Another option to set the values of these properties is programmatically using the API Reference.

Regards,
Nasko
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Carl
Top achievements
Rank 1
answered on 25 Oct 2017, 11:15 AM

Hi Nasko!

Thank's for a quick reply. I found out how to use bindings, bound items are even marked in the properties overview.

br. Carl Høgstedt

Tags
Report Designer (standalone)
Asked by
Craig
Top achievements
Rank 1
Answers by
Craig
Top achievements
Rank 1
Nasko
Telerik team
Carl
Top achievements
Rank 1
Share this question
or