Telerik Forums
Reporting Forum
5 answers
442 views
Hello.

I have a report which we are rendering as a PDF. This report has one HTMLTextBox, which we wish to use to display the contents of an HTML email. (I am using 2010 Q3).

I'm finding that I can successfully set HTML into the HTMLTextbox in the designer, and have the HTML display in the report. However, if I try to set the HTML into the textbox in my databinding function, the report still shows the data entered in the designer, it has not been overriden with the data from the databinding function. Having no data in the HTMLTextbox in the designer does not change the behavior; in that case in the report the textbox will be empty

So, referencing the code below, the generated report is displaying 'hard coded paragraph", rather than "my paragraph". I have verified that the textBoxContents_ItemDataBound function is being called, that the bodytextbox variable is NOT null, and that when the function exits the bodytextbox.Value is still equal to the HTML set in the method.

Here are some bits of code that I think might be relevant. Thanks for your help!

        private void InitializeComponent()
        {
            this.textBoxContents.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.700118362903595D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.2142907381057739D, Telerik.Reporting.Drawing.UnitType.Inch));
            this.textBoxContents.Name = "textBoxContents";
            this.textBoxContents.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.7998027801513672D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.28570938110351562D, Telerik.Reporting.Drawing.UnitType.Inch));
            this.textBoxContents.Value = "<html><p>hard coded paragraph.</p></html>";
            this.textBoxContents.ItemDataBound += new System.EventHandler(this.textBoxContents_ItemDataBound);
      }
 
   private Telerik.Reporting.HtmlTextBox textBoxContents;

        private void textBoxContents_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.HtmlTextBox bodytextbox = sender as
                Telerik.Reporting.Processing.HtmlTextBox;
            if (bodytextbox != null)
                bodytextbox.Value = "<html><p>My paragraph.</p></html>";
        }
Mark
Top achievements
Rank 1
 answered on 15 Jul 2011
4 answers
179 views
Hi,

In my report header I have a number of fields placed vertically.  If there is no data for one or more of these fields I would like the fields with data to move up vertically to take the place of the missing fields i.e. same functionality as a vertically oriented stackpanel.  Each field has a matching label with a different format to the data field (if they all had the same format I could achieve this quite simply in a single textbox): 

Contact: John
Phone: 555-555-5555
Fax: 555-555-55555
Email: john@company.com

(e.g. if there was no Fax number for John then the email row would move up to to the position of the Fax row).

I imagine I could do this in code by positioning the fields manually but I'm hoping there is a better way.

What is the recommended method for achieving this?

Thanks,
Steve
Stephen
Top achievements
Rank 1
 answered on 15 Jul 2011
1 answer
167 views
We have a report that integrates a number of subreports, and generally only a couple of them will have data for any particular parent item. Is it possible to programmatically hide the subreport if there are no rows?

TIA.
Steve
Telerik team
 answered on 15 Jul 2011
4 answers
161 views
HI there folks

i've just tried to upgrade my solution 

which had been using Telerik Reports Q1 2011

and i've tried upgrading it to Telerik Reports Q2 2011

the upgrade goes through successfully 

but when I try to build I recieve the following error message on all of my Report Designer.cs files


'Telerik.Reporting.ReportParameter' does not contain a definition for 'UI' and no extension method 'UI' accepting a first argument of type 'Telerik.Reporting.ReportParameter' could be found (are you missing a using directive or an assembly reference?
IT
Top achievements
Rank 1
 answered on 15 Jul 2011
1 answer
471 views
I am using the report controls in our mvvm silverlight application. I am passing in 5 different parameters within a dictionary. the last item in this dictionary is a List<int>. This list contains ids that I will then use against an entity to create my report from. 

I am finding no luck anywhere on how to pass in a generic list as a parameter. Again we are using an MVVM pattern so the examples I have seen online that use codebehind are not much help. I am sure that I am missing something within the report itself that will allow me to use a Generic list.
Steve
Telerik team
 answered on 15 Jul 2011
2 answers
135 views
Hi,
   I have one web solution and trying to create reports. I added a folder "Reports" to that solution and trying to add Telerik Report. It is asking me to add in "app_code" folder. If I click NO, It is just showing code behind file. I can not see the designer. Is there anything I am missing.


Thanks
Chiran
Steve
Telerik team
 answered on 15 Jul 2011
4 answers
322 views
Hi,
I am using Reporting Q1 2011 and am trying to make a report that contains a subreport. I am using a ObjectDataSource for this report. I am not setting the datasource for the subreport, I am using the NeedDataSource event to do that. Problem is, I can't figure out how to refer to the element I need. I downloaded an example from this site http://www.telerik.com/community/forums/reporting/telerik-reporting/sample-for-master-detail-using-object-collection-as-datasource.aspx that shows how to do this, but it's from an older version and the .DataItem property is no longer available. I can't seem to find a current example of how to do this. So how exactly does one gain access to dataitems in a business object so that the datasource of the subreport can be set correctly using Q1 2011?

Thanks
John
Top achievements
Rank 1
 answered on 14 Jul 2011
3 answers
124 views
Hi,
I've just updated my reports from the Q3 2010 release to the new Q2 2011 release and on all reports I am now getting the following error when previewing the report in VS: "The source of the report definition has not been specified".

In the code behind the report I manually setup the datasource and it was working perfectly till now.  

Is there some obvious breaking change that has caused this to appear?

Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 14 Jul 2011
15 answers
733 views
Hello,
I want to display some fields in Hyperlink , as when clicked go to specific from , please if it's available tell me how .
Thanks in advance

Kariem Samy
bas
Top achievements
Rank 1
 answered on 14 Jul 2011
3 answers
87 views
I have a report that uses a line chart to show a trend of data across a date range. Code has been put in place to compensate for how the x-axis labels are rendered so that a large date range is readable. On the NeedDataSource event for the chart, I fetch the data then use the following code to adjust the x-axis label.

int labelStep = (dataList.Count / 10);
 
chartTrendByDay.DataSource = dataList;
if (labelStep == 0)
    labelStep = 1;
chartTrendByDay.PlotArea.XAxis.LabelStep = labelStep;

When viewing the report in the ReportViewer, the above code results from 1..10 points on the x-axis. The problem is, when exporting to PDF I end up with 1 point for each day (i.e. a report for the trend across the year results in 365 data points), which is unreadable in most circumstances. See attached for the viewer-vs-PDF screenshots.

Question: How to I fix the export to PDF so that the x-axis is readable?
Steve
Telerik team
 answered on 14 Jul 2011
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?