Telerik Forums
Reporting Forum
3 answers
168 views

Hi to all,

something strange happens to me.

I have a report that contains a subreport. Subreport generates several records, each record is 1/4 tall of an A4 page.

If I try to render report into Visual Studio 2017 I see all correct, and if I try to save in RTF format it generates all.

But if I try to generate RTF file by code, if I open rtf file with Word content of subreport is truncated after some records.

What's happend?

01.public static Bundle SaveAsWord(string fileName, Bundle pBundle)
02.        {
03.            Bundle bundle = new Bundle();
04. 
05.            try
06.            {
07.                //Create new CultureInfo
08.                var cultureInfo = new System.Globalization.CultureInfo(pBundle.Get(2).ToString());
09. 
10.                // Set the language for static text (i.e. column headings, titles)
11.                System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo;
12. 
13.                // Set the language for dynamic text (i.e. date, time, money)
14.                System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;
15. 
16.                Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
17. 
18.                // set any deviceInfo settings if necessary
19.                System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
20. 
21.                Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();
22. 
23.                // reportName is the Assembly Qualified Name of the report
24.                typeReportSource.TypeName = typeof(OffertaVenditaBrema).AssemblyQualifiedName;
25.                typeReportSource.Parameters.Add("NumeroOfferta", pBundle.Get(1).ToString());
26.                typeReportSource.Parameters.Add("MostraPrezziListino", pBundle.Get(3).ToString());
27.                typeReportSource.Parameters.Add("MostraPrezziNetti", pBundle.Get(4).ToString());
28.                typeReportSource.Parameters.Add("SfondoGrigio", pBundle.Get(5).ToString());
29.                typeReportSource.Parameters.Add("TestoBianco", pBundle.Get(6).ToString());
30.                typeReportSource.Parameters.Add("MostraTabellaPrezzi", pBundle.Get(7).ToString());
31. 
32.                Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("RTF", typeReportSource, deviceInfo);
33. 
34.                //string fileName = result.DocumentName + "." + result.Extension;
35.                string path = System.IO.Path.GetTempPath();
36.                string filePath = System.IO.Path.Combine(path, fileName);
37. 
38.                using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
39.                    fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
40. 
41.                bundle.Add(1, true);
42.                bundle.Add(2, filePath);
43.            }
44.            catch (Exception ex)
45.            {
46.                bundle.Add(1, false);
47.                bundle.Add(2, ex.Message);
48.                bundle.Add(3, ex.StackTrace.ToString());
49.            }
50. 
51.            return bundle;
52.        }

 

Silviya
Telerik team
 answered on 03 Apr 2018
1 answer
85 views

What is the purpose of CategoryGroup.Label as highlighted in the attached graphic?  I have a report with categories for each week of the year, but want to display the week start date not the week number.  So I thought I could set to Numeric scale using the week of the year (which comes from the SQL), but change the label to come from the week start date (also from the SQL), but this appears to have no effect.

Thanks,

 

Scott

 

Katia
Telerik team
 answered on 02 Apr 2018
0 answers
200 views

Hi All,

I have telerik report 2018 r1 but after configuration it still doesnt show in browser.

below is the code

var reportSource = new Telerik.ReportViewer.Html5.WebForms.ReportSource();
               reportSource.IdentifierType = IdentifierType.UriReportSource;
               reportSource.Identifier = "test.trdp";
               //    reportSource.Parameters.Add("Date", DateTime.Today.AddDays(25));
               ReportViewer1.ReportSource = reportSource;

 

 

Edwin
Top achievements
Rank 1
 asked on 01 Apr 2018
3 answers
265 views

Hi to all,

I export to MS Word from a Report. This report is a quote document. Users show me a problem to manipulate simply the exported document in MS Word.

This problem is caused by rendering all TextBox (of report) into a grid layout of word. But where there is not a value, it not generates a cell.

User can't write into "ghost cell".

Can I void to generate MS Word using grid?

Katia
Telerik team
 answered on 30 Mar 2018
1 answer
147 views

I was using Telerik 2014 Q2 SP1 and upgraded my report to 2018 R1 and one of my reports does not show a parameter I am passing down. 

 

Report A has a subreport (Report B) and Report A creates a parameter for Report B 

    instanceReportSource1.Parameters.Add(new Parameter("SampleParameter", "=Fields.SampleParameter"));

In my code for Report B I want to pull the parameter value that is being passed in order to filter some data, so I have: 

     var param = Convert.ToInt32(this.ReportParameters["SampleParameter"].Value);

This worked just fine before and instead of this.ReportParameters["SampleParameter"].Value having a value it just says the value is  "=Fields.SampleParameter". 

 

Was there a change in how parameters were retrieved or accessed in this way? 

Silviya
Telerik team
 answered on 29 Mar 2018
2 answers
318 views

Is it possible to make a custom toolbar, with different icon images, etc. and drop downs similar to the one outlined in the article for the Web ReportViewer (custom-toolbar-for-the-web-)?

 

thanks.

Damien
Top achievements
Rank 1
 answered on 29 Mar 2018
27 answers
729 views
> Does Telerik have the capability of Ad Hoc Query Building / Report Making in real time, on the fly from the front end GUI?

> Like is possible with the software available at this link

Akshay.
Milen | Product Manager @DX
Telerik team
 answered on 28 Mar 2018
7 answers
1.6K+ views
Hello,
I have a function that will return my dataSource to telerik report. 
But i have some doughs? 

See the above sample 
public class dataSourceObj 
    public string Name {get; set;} 
    public ComplexType ComplexDto {get; set;} 
}  
 
public class ComplexType  
    public string ComplexTypeName {get; set;} 
    public int id  {get; set;} 
    public List< subType> subTypeList {get; set;} 
 
public class subType 
    public string subTypeName {get; set;} 
    public int id  {get; set;} 
    public int ComplexTypeid  {get; set;} 
 

So if i create a datasource to my report and set some function to return the dataSourceObj class i will see the properties Name, complexType, and inside this one i will see -> ComplexTypeName and id but not subTypeList.

Why this is happening?

Best Regards
Marco Teodoro
Asmaa
Top achievements
Rank 1
 answered on 28 Mar 2018
6 answers
484 views

Hi All,

Please bear with me, as I am new to this :).

 

I am developing a WindowsForm C# application using Telerik controls and I have progressed far enough that I am needing to now do the reports section.

1. Is there a video tutorial to go through on how to create Reports?
2. Some of my reports are essentially a form that I just fill data into, can I use Reporting for this too?
3. The data I generate on the fly, there is no configured data source binding within the WindowsForm application.
4. I generally have a "print to screen" button to display the data in a popup window and then I can generate the report from this popup (or just print it directly without the popup - would it be better to create the report and use a viewer to show it for the "print to screen" option.
5. Can the reports be exported to PDF or other applications?
6. The database is a Microsoft SQL database.

 

Can someone please guide me in the right direction?

 

Thanks in advance.

Damien

 

Todor
Telerik team
 answered on 27 Mar 2018
3 answers
294 views
Hello,

Is it possible, that a Report Table which is bound to a
objectDataSource
in case the Method returns count 0 items, that the whole table is invisible? (SubReport)


I also have a problem, when
objectDataSource
gets count 0, I get and error in the report, I would love, that the binding would not take part in this case and return an empty report?

Thanks a lot!
Silviya
Telerik team
 answered on 27 Mar 2018
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?