Setting maximum and Minimum datetime

8 posts, 0 answers
  1. Craig
    Craig avatar
    19 posts
    Member since:
    Jun 2014

    Posted 01 Jul 2014 Link to this post

    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?
  2. Craig
    Craig avatar
    19 posts
    Member since:
    Jun 2014

    Posted 03 Jul 2014 Link to this post

    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
  3. Nasko
    Admin
    Nasko avatar
    945 posts

    Posted 04 Jul 2014 Link to this post

    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.

     
  4. Craig
    Craig avatar
    19 posts
    Member since:
    Jun 2014

    Posted 07 Jul 2014 in reply to Nasko Link to this post

    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
  5. Nasko
    Admin
    Nasko avatar
    945 posts

    Posted 10 Jul 2014 Link to this post

    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.

     
  6. Carl
    Carl avatar
    3 posts
    Member since:
    Aug 2017

    Posted 24 Oct in reply to Craig Link to this post

    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);
    }                            

  7. Nasko
    Admin
    Nasko avatar
    945 posts

    Posted 24 Oct Link to this post

    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
  8. Carl
    Carl avatar
    3 posts
    Member since:
    Aug 2017

    Posted 25 Oct in reply to Nasko Link to this post

    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

Back to Top