Telerik Forums
Reporting Forum
1 answer
89 views


Can I have two different data types loading to the same category scale on the graph? I need to display DATE and VARCHAR2 on the x axis. Is that possible, or should I convert the date to varchar2 to have only varchar2 coming in from the database? Currently, I am planning to have number in numerical scale and date and varchar2 in category scale.
(So far the number in numerical scale and date in category scale works)
KS
Top achievements
Rank 1
 answered on 10 Mar 2014
1 answer
140 views
hi,

i have the following situation, working report with some input parameters and defined groups in report.
When i add new parameter on report, code for my groups in designer.cs file disappears. When i try access them in code they always trow null Exception.
I have some code in report  ItemDataBinding event for group manipulation.

example:

if (!string.IsNullOrWhiteSpace((string)ReportParameters["DatumOd"].Value) && !string.IsNullOrWhiteSpace((string)ReportParameters["DatumDo"].Value))
            {
                this.group2.Groupings.Clear(); 
                this.group2.Groupings.AddRange(new Telerik.Reporting.Grouping[] { new Telerik.Reporting.Grouping("=Fields.Sifra") });
                //this.group2.Sortings.AddRange(new Telerik.Reporting.Sorting[] { new Telerik.Reporting.Sorting("=", Telerik.Reporting.SortDirection.Asc) });
                this.groupFooterSection2.Visible = false;
            }
            else if (!string.IsNullOrWhiteSpace((string)ReportParameters["RazdobljeOd"].Value) && !string.IsNullOrWhiteSpace((string)ReportParameters["RazdobljeDo"].Value))
            {
                this.group2.Groupings.Clear();
                this.group2.Groupings.AddRange(new Telerik.Reporting.Grouping[] { new Telerik.Reporting.Grouping("=Fields.Razdoblje") });
                //this.group2.Sortings.AddRange(new Telerik.Reporting.Sorting[] { new Telerik.Reporting.Sorting("=", Telerik.Reporting.SortDirection.Asc) });
            }

Hinata
Top achievements
Rank 1
 answered on 10 Mar 2014
1 answer
1.2K+ views
I'm using the report designer.

I would like to find out whether it is possible to change the background color of a textbox based on its value.
So instead of showing the value, I'm just showing the value as the background color.
Stef
Telerik team
 answered on 10 Mar 2014
1 answer
53 views
I followed explicitly the How To instructions listed on http://www.telerik.com/help/reporting/graphhowtocreatecolumnchart.html
I found that the resulting Column Graph is not the same as the one displayed on the web page named above.
Also, I followed explicitly the How To instructions listed on http://www.telerik.com/help/reporting/graphhowtocreatepiechart.html
I found that the resulting Pie Graph displays properly in the Designer.  However, it does not display properly when I click on the Preview tab or the Html Preview tab.  Also, this Pie Graph does not display properly on my web form which references the class library containing the report which has the Pie Graph named above.  Is there any omission or inaccuracy in the How To instructions given on those web pages named above?  Thank you.
Peter
Telerik team
 answered on 10 Mar 2014
1 answer
164 views
Hello,

I am currently evaluating the use of Reporting in a project and I got a test page up and running in ASP.NET 4.5.

However, I noticed that my report (which uses a SQL Server Data Source) is executing the query using the application pool identity. Is there any way to run the query using the current user's identity?


Thanks in advance
Stef
Telerik team
 answered on 10 Mar 2014
1 answer
170 views
So we have used the standalone designer to create a report, we are using an ObjectDataSource (and access method of that object to return data). This works completely fine, and we are able to preview our test data while designing the report.

In our web application we deserialize the report file (*.trdx) in order to change the report DataSource and use real data like this:

      XmlReaderSettings settings = new XmlReaderSettings() { IgnoreWhitespace = true };
      Telerik.Reporting.Report rpt;
      String file = Server.MapPath("~/Reports/OurReport.trdx");
      using (XmlReader xmlReader = XmlReader.Create(file, settings)) {
        ReportXmlSerializer xmlSerializer = new ReportXmlSerializer();
        rpt = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
      }
      InstanceReportSource ReportSource = new InstanceReportSource();
      ReportSource.ReportDocument = rpt;
      ReportSource.ReportDocument.Reports.FirstOrDefault().DataSource = GetData();

What I am unclear about, is whether or not the report goes through the process of loading up all our test data first, before we acquire the real data (i.e. GetData()) and assign it to the DataSource. If we comment out the DataSource assignment we'll see the test data displayed in the report viewer, which makes me wonder. I definitely don't want the report to go through the trouble of generating data that is just going to be overwritten. Can someone clue me in on the order of operations in regards to this, so we can avoid any unnecessary overhead.


Stef
Telerik team
 answered on 07 Mar 2014
1 answer
215 views
Hi,

I have just noticed an exception when trying to export a report to RTF from the WebViewer control which now throws the following error:

Attempt by security transparent method
'Telerik.Reporting.Rtf.ImageUtils.GetMetafileBounds(System.Drawing.SizeF)' to
call native code through method
'Telerik.Reporting.Rtf.GdiNativeMethods.GetDeviceCaps(IntPtr, Int32)' failed.
 Methods must be security critical or security safe-critical to call
native code.

The exception occurs on my local Dev Environment (Windows 8 with IIS 8) and our Staging server (Windows Server 2012 R2 with IIS 8.5) and is using .Net 4.5

Any ideas why this is occurring?

Stef
Telerik team
 answered on 07 Mar 2014
0 answers
483 views
Hi David,

The CDbl function converts the expression to double and this is limitation of the data type. For more info see: double (C# Reference). Still you can utilize user functions to convert the values and make the required calculation.

Best Regards,
Petar
Peter
Telerik team
 asked on 07 Mar 2014
3 answers
119 views
What Im trying to achieve is to load a dynamic externalstylesheet, where in the style rules can be configurable.

Unfortunately, I can not make this to work. Im getting the following error:

An error has occurred while processing Report 'MyReport':
For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing

I also tried to use stream buy the errors says the buffer can not be null even though Im passing the right byte array.

Here are the codes:

public MyReport(Uri stylesheet): this()
{
   this.ExternalStyleSheets.Clear();
   this.ExternalStyleSheets.Add(new ExternalStyleSheet(stylesheet));
}

ReportController

public ActionResult MyReport()
{
   var xml = new Uri("http://mydomain.com" + Url.Action("ReportStyleSheet", "Theme"));
   var report = new MyReport(xml);
   return ReportViewer(report);
}
 
private ViewResult ReportViewer(Report report)
{          
   return View("ReportViewer", report);
}

ThemeController
public ActionResult ReportStyleSheet()
{
   var xml = string.Empty;
 
   if (this.Request.IsAuthenticated)
   {
    //replaceDictionary replaces the color schemes
    xml = template.BuildTemplate("ReportStyleSheet.xml", replaceDictionary);
   }
 
   return Content(xml, "application/xml");
         
}


ReportViewer.aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Telerik.Reporting.Report>" %>
 
<%@ Register assembly="Telerik.Reporting, Version=7.0.13.521, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.Reporting" tagprefix="telerik" %>
 
<%@ Register assembly="Telerik.ReportViewer.WebForms, Version=7.0.13.521, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.ReportViewer.WebForms" tagprefix="telerik" %>
 
<telerik:ReportViewer ID="ReportViewer1" style="height: 700px; width: 100%; margin-bottom: 30px;" runat="server"></telerik:ReportViewer>


<script runat="server">
     
public override void VerifyRenderingInServerForm(Control control)
{
   // to avoid the server form (<form runat="server"> requirement
}
 
protected override void OnLoad(EventArgs e)
{
   base.OnLoad(e);
   try
   {
      var instanceReportSource = new InstanceReportSource();
                 
      instanceReportSource.ReportDocument = Model;
      ReportViewer1.ReportSource = instanceReportSource;
   }
   catch (Exception ex)
   {
      Response.Write(ex.Message);
   }
}    
        
</script>
Stef
Telerik team
 answered on 06 Mar 2014
6 answers
700 views
If I create a blank report, add a picturebox control, set the value to point to a JPG file (logo in this case) and then try to preview either in VS or with a test page using the viewer control, I get this error (numerous times):

Code generation for property 'Value' failed. A generic error occuered in GDI+.

Anybody have any ideas? The error was discovered on a more complex report but in testing it I discovered I could reproduce it with a blank/empty report. Any help or sugestions would be appreciated.

Thanks
richard
Top achievements
Rank 1
 answered on 06 Mar 2014
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?