Author
|
Message
|
Joseph Fabian
|
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 5,
Visits: 1
|
Hello, I'm using the evaluation version of the charting tool for SSRS. When trying to preview a simple chart I'm receiving the following error message: NChart Rendering Failed. Exception was: The object is not compatible with the data series type. This is a line chart with times along the vertical axis, categorized by a process ID and labeled with a process name on the horizontal axis. The time data is pulled from a stored procedure as Time(0) having the format of hh:mm:ss . The vertical axis has the Sub Type set to DateTime (don't know if that's relavent). This works with a standard SSRS chart, but I'm not understanding where the object incompatibility exists. Below is a screen shot of chart in development. Interestingly, when I remove the "=" from the Start Time expression, the chart displays without data, and without error. I'm relatively new to charting in general. Any ideas or suggestions are most appreciated. Thanks, Joe Hello,
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: 6 hours ago
Posts: 3,054,
Visits: 4,009
|
Hi Joe, Can you submit the report with some sample data for review? - it must be something small we're dealing here (most likely its the time format as it was introduced in 2008).
Best Regards, Nevron Support Team
|
|
|
Joseph Fabian
|
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 5,
Visits: 1
|
Thanks for the quick reply. Attached is the rdl file and an excel sheet with some sample data. Pleae note, there's a mistake in the screen shot I posted. The X-Axis should plot by Execution Date, not by process description. So there should be StartTime along Y, ExecutionDate along X, and the series lines should represent ProcessID - sorry for the confusion. The rdl file includes the Nevron chart with data inputs described above. The sample data includes data type descriptions returned from the SP. Thanks for taking a look at this. We're eagerly seeking a replacement to the very limited SSRS charting capabilities. Please let me know if there are any questions. Joe
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: 6 hours ago
Posts: 3,054,
Visits: 4,009
|
Hello Joe, Can you please re-submit your files since there was no attachements with your posts. You can try attaching a ZIP archive.
Best Regards, Nevron Support Team
|
|
|
Joseph Fabian
|
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 5,
Visits: 1
|
Thank you. Here is the zip file.
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: 6 hours ago
Posts: 3,054,
Visits: 4,009
|
Hi Joseph, Thank you for submitting the rdl/data. After further investigation the problem is indeed related to the time fields passed to the control. There are actually two problems related to that: 1. The Values collection of the control does not recognice .NET TimeSpan objects (we've fixed that and it will appear in the next SP of the control). 2. The control cannot label time spans - only date time. In order to do this you need to rescale the TimeSpan to date time with some origin.
The workarounds are: 1. In the stored procedure you can output DateTime instead of time (recommended). 2. You can rescale the double values produced by the time span to date time using some origin date. The following code for example does that for all values: using System; using System.Drawing; using System.Diagnostics; using Nevron.GraphicsCore; using Nevron.Chart; using Nevron.ReportingServices; namespace MyNamespace { /// <summary> /// Sample class /// </summary> public class MyClass { /// <summary> /// Main entry point /// </summary> /// <param name="context"></param> public static void RSMain(NRSChartCodeContext context) { for (int ci = 0; ci < context.Document.Charts.Count; ci++) { NChart chart = context.Document.Charts[ci]; foreach (NSeries series in chart.Series) { for (int i = 0; i < series.Values.Count; i++) { try { double value = (double)series.Values[i]; value = (new DateTime() + TimeSpan.FromTicks((long)value)).ToOADate(); series.Values[i] = value; } catch (Exception ex) { Debug.WriteLine(ex.Message); } } } } } } }
Rescales the spans relative to zero date (1899). Note that all values should be imported with Sum in this case (so that you don't have TimeSpan objects in the input data). Hope this helps - let us know if you have any questions or meet any problems.
Best Regards, Nevron Support Team
|
|
|
Joseph Fabian
|
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 5,
Visits: 1
|
Thank you for the explanation. I'd like to give the code a try, where in SSRS would that be placed, and how would it be called from the chart? Thanks, Joe
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: 6 hours ago
Posts: 3,054,
Visits: 4,009
|
Hi Joe, There is a tab named "Code" in the chart designer. You have to copy/paste the code there. Let us know if you meet any problems.
Best Regards, Nevron Support Team
|
|
|
Joseph Fabian
|
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 5,
Visits: 1
|
Thank you, that worked very well. We now have the same situation we're facing with SSRS, which we're hoping Nevron will allow us to overcome. We're plotting two lines on the chart, a start-time and an end-time. Occasionally, the end time will occur past midnight. When this happens, the end-time is plotted below the start-time causing the lines to appear inverted (attached screen shot). For example, A process can begin at 9pm and finish five hours later at 2am. In such case, we need the 2am end-time plotted above the 9pm start-time. SSRS has been forcing the end time to plot below the start in this case. Is there a way for the Nevron chart to always plot one series above another, and adjust the axis accordingly? Thanks, Joe
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: 6 hours ago
Posts: 3,054,
Visits: 4,009
|
Hi Joe, Yes - in this case you can write some code that maintains the relationship - ValueGrayLine(n) - ValueOrangeLine(n) > 0, for example by taking the absolute difference between each pair of values. There are other approaches and that is to have a scale that still maintains some date information (so that 2am next day plots above 9pm). We would suggest an online meeting to discuss (it's free) as it will be more productive than exchanging posts in the forum - if you want to go this way please send an e-mail to support@nevron.com with time/date that is convenient for you.
Best Regards, Nevron Support Team
|
|
|