Telerik Forums
Reporting Forum
7 answers
383 views
I have a EF 6 datasource configured and working but I'm finding it very limited.  There seems to be no way to query the datasource using Linq from the designer.  I was expecting it to work like the SQL datasource where a query can be specified and then embedded in the report.
Nasko
Telerik team
 answered on 16 Apr 2014
2 answers
94 views
Hello, 

I'm working on an applicationt that is using wcf services to access a remote database, and csv stored to the isolated storage for managing offline mode. 
The need I have it's to give users the possiblity to continue generating reports using local data. Is it possible to do it using Telerik SL components? 

Thanks a lot for your help. 
Regards
Stef
Telerik team
 answered on 16 Apr 2014
5 answers
263 views
Hi,

I have created a C# windows forms application to export reports programatically. Reports are created using standalone report designer and added in a folder within the application. Reports have a multivalue parameter site whose value is set to AllValues(Fields.Id). AllValues function by default selects all site values. While running the application, report is exported programmatically. But, when I check the report that is created, it has the following message
An error has occurred while processing Report 'GameMetric':
The expression contains undefined function call AllValues().
Following is the piece of code which exports report programmatically.
try
                    {
                        Telerik.Reporting.UriReportSource URI = new Telerik.Reporting.UriReportSource();
                        string reportKey = dt.Rows[i]["report_key"].ToString();
                        string reportName = dt.Rows[i]["report_name"].ToString();
                        appendMessage("Run Report: " + reportName, ref message);

                        if (dt.Rows[i]["CustomFlag"].ToString() != "Y")
                            URI.Uri = Directory.GetCurrentDirectory() + "\\Reports\\" + reportKey + ".trdx";
                        else
                            URI.Uri = Directory.GetCurrentDirectory() + "\\Reports\\" + "Dynamic Report.trdx";

                        XmlReaderSettings settings = new XmlReaderSettings();
                        settings.IgnoreWhitespace = true;
                        using (XmlReader xmlReader = XmlReader.Create(URI.Uri, settings))
                        {
                            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
                            ReportViewer reportViewer = new ReportViewer();
                            Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer =
                                                  new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();

                            Telerik.Reporting.Report report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
                            string newConn = Common.changeConnectionString(Properties.Settings.Default.ParafaitConnectionString, "ParafaitMultisite");
                            System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
                            //SetConnectionString(newConn, report);
                            reportViewer.Report = report;
                            reportViewer.ReportSource.Parameters.Add("fromdate", fromDate.ToString());
                            reportViewer.ReportSource.Parameters.Add("todate", toDate.ToString());
                            //reportViewer.ReportSource.Parameters.Add("offSet", Convert.ToString(ParafaitTimezone.FinalOffset()));
                            reportViewer.ReportSource.Parameters.Add("user", "Parafait Scheduler");
                            reportViewer.ReportSource.Parameters.Add("loggedInUserName", "Parafait Scheduler");
                            reportViewer.ReportSource.Parameters.Add("role", " ");
                            reportViewer.ReportSource.Parameters.Add("loggedInUserId", Common.getLoggedinUser());
                            string reportID = dt.Rows[i]["report_id"].ToString();
                            reportViewer.ReportSource.Parameters.Add("reportID", reportID);
                            reportViewer.ReportSource.Parameters.Add("isCorporate", "Y");
                            //reportViewer.RefreshReport();
                            string fileName = "D:\\Parafait Home\\Reports\\" + reportName + TimeStamp + ".pdf";
                            try
                            {
                                Telerik.Reporting.Processing.RenderingResult renderingResult = reportProcessor.RenderReport("PDF", reportViewer.ReportSource, deviceInfo);
                                using (FileStream fs = new FileStream(fileName, FileMode.Create))
                                {
                                    fs.Write(renderingResult.DocumentBytes, 0, renderingResult.DocumentBytes.Length);
                                }
                            }
                            catch (Exception ex)
                            {
                                appendMessage(ex.Message, ref message);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        appendMessage(ex.Message, ref message);
                    }
                }
                
                appendMessage("Done creating reports", ref message);

I have added the assembly reference in report designer config file.

When I run the same set of reports in a web form it seems to be working without any issues.
What wrong could I have done?
Hinata
Top achievements
Rank 1
 answered on 16 Apr 2014
5 answers
143 views
Guys,
This is a breaking change and I haven't yet figured out why it is happening to my project when I am upgrading to Q1 2014.
The xaml code is -
             xmlns:tr="http://schemas.telerik.com/wpf"

        <tr:ReportViewer x:Name="reportViewer" HorizontalAlignment="Stretch" Margin="10"
                         ReportSource="{Binding ReportSource}">
            <telerikControls:StyleManager.Theme>
                <telerikControls:Windows7Theme />
            </telerikControls:StyleManager.Theme>
        </tr:ReportViewer>

Application breaks in execution with message -
'The invocation of the constructor on type 'Telerik.ReportViewer.Wpf.ReportViewer' that matches the specified binding constraints threw an exception.' Line number '34' and line position '10'

I am referencing to following dlls in the project :
1. Telerik.reporting - v4.0.30319
2. Telerik.ReportViewer.Wpf - v4.0.30319
3. Telerik.Windows.Controls - v4.0.30319
Stef
Telerik team
 answered on 16 Apr 2014
5 answers
1.2K+ views
Hi All,

I have report with a picturebox:

Size = 2in, 0.76in
Anchor = Right, Top
Sizing = ScaleProportional

I would like to have the content of the picture box aligned to the right side. Is there any way how to do that? 

In more detail:
The value of the image is set in the code based on the current customer logo. Each customer has different proportion of their logos. The size of the PictureBox is the maximum size the logo could occupy on the report. I want to have the logo as big as possible (but not more then the maximum size) and be aligned to the right side of the report.

Thank you!

Pavel
Joel
Top achievements
Rank 2
 answered on 16 Apr 2014
12 answers
344 views
Should i be able to use multipe subreports in a report ?

i have a reports on a DataSet created from an XML file. The main report is on table A. The first subreport is on table B. I created a second subreport and set its datasource to table C but it always shows the data from table B

i am using the NeedDataSource event in the main report to load the xml file and set the datasource of the main report to its table

i am also using the NeedDataSource event for each subreport to set their datasources.

no matter what i do the second subreport always shows the same data as the first subreport

is it not possible to have multiple subreports ?

thanks

Mike


PAGCA
Top achievements
Rank 1
 answered on 15 Apr 2014
3 answers
293 views
Hi,

I have a simple case scenario where I programatically export my report to various file format then email our report to our customer.
Now it happens that those reports contains no data and in this case we want to send a proper email informing them that their report contains no data (which is good usually because we send alerts report :) )

anyway, it sounds like a simple enough scenario though I couldn't yet place my hand onto it ...

code looks like this:
RenderingResult result = reportProcessor.RenderReport(exportFormat, telerikReport, null);
 if (result.HasErrors)
wish I could say if error == "No data" then ...else ...

any help / suggestion?
Regards
Jim
PS: version used Q1 2011 SP1 (5.0.11.510)...I know time to upgrade right ;)
Peter
Telerik team
 answered on 15 Apr 2014
5 answers
525 views
Using Reporting Q1 2013. I have a HTMLTextbox inside a data bound table column. When report runs, the HTML content shows up fine but text appears to be trimmed because it's not automatically wrapping. See the attached screen shot.

HTMLTextbox has 'CanGrow = True' and 'CanShrink = False'.

Appreciate your help.
Stef
Telerik team
 answered on 15 Apr 2014
4 answers
553 views
Hi,

Does Telerik Reporting support this feature? For example I have a report shows
all orders for a customer as following format
Order #, Item #, Price, Qty, Amount.
Most orders contains more than one item, can we just print the forst order # and leave the rest order # blank? I know we can create a group base on order #, and put the order # into the group header, but that will occupy an extra row (the group header) and the right side does not have anything to print.

Thanks in advance
-phelix
Nasko
Telerik team
 answered on 15 Apr 2014
1 answer
68 views
I have an object data source that looks a bit like

ThingData
    Location
    ThingName
    ThingId
    SummaryData (List)
           SummaryA
                Field
                Field
           SummaryB
                Field
etc.

I have grouped by 'ThingId' and I have added List to the detail section of the of the Report. The List DataSource is set to SummaryData.

In the List I can use SummaryA and SummaryB fields, everything is fine.

In Print Preview (and Export) however, there is always a page break before each List, even though it could fit on the preceding page. It works fine in the standard view.

I searched this forum and found references to this being a bug due to be fixed, that post was in 2013. Looking at other options:

- Grouping: I don't think I can group unless I flatten my data

- SubReport: This would mean a SQL call for each SummaryData row, which I want to avoid

Anyone have any suggestions? Thanks.



Nasko
Telerik team
 answered on 15 Apr 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?