Telerik Forums
Reporting Forum
12 answers
1.3K+ views

Hi,

I want end-users to design their own reports to run in an application where the database connection is dynamic. This was sort-of covered in a previous post but now that I understand things better I wanted to ask the right questions. The options I have got are:

1. Use sql connector in the designer with a 'shared' connection string (where the alias is the same name as stored in web.config). This works great as the user can do their own joins using the query builder, slap the reports into the website and they work. BUT there is no connection string in my web.config, it is stored elsewhere.

2. Extend the standalone designer so the users can use an Object Datasource to use my custom dll BUT then all the joins need to be pre-defined in the dll code. (I have already got this working, but joining all the tables is a real problem + confusing for the uesr)

 

So what I want to ask - is there any way I can use case 1 by switching the connection string at run time (I have all the info available in memory, it's just not static in web.config)?

 

Andrew
Top achievements
Rank 1
 answered on 21 Dec 2016
12 answers
1.5K+ views
I want my report to have have Landscape orientation. Changing the preview is not a problem:

          Report.PageSettings.Landscape = true;

However when I click print button the default printer setting is Portrait. I cannot convince my customer to have Landscape as a system wide default setting so I need to change it before opening PrintDialog. It can be done too:

            PrintDialog dialog = new PrintDialog();
            LocalPrintServer.GetDefaultPrintQueue().DefaultPrintTicket.PageOrientation = PageOrientation.Landscape;
            dialog.PrintQueue = LocalPrintServer.GetDefaultPrintQueue();
            dialog.PrintTicket = dialog.PrintQueue.DefaultPrintTicket;
            dialog.PrintTicket.PageOrientation = PageOrientation.Landscape;
            dialog.ShowDialog();

The problem is that ReportProcessor.PrintReport does not accept PrintTicket (returned by PrintDialog) and want PrinterSettings which are not available under .NET 3.5.

Is there any way to overcome the problem?

Any suggestion would be appreciated

Stef
Telerik team
 answered on 21 Dec 2016
1 answer
194 views
I have a report that is made up of four different charts, that all use the same data, just grouped and displayed differently.  Originally, I had them all pointing to the same DataSource, but then found that it was running the same exact query four times, one for each part.  Then I came across this thread: http://www.telerik.com/forums/multiple-database-hits-for-same-datasource which seems to explain the solution.  I tried the proposed solution, which is setting the top-level Report's DataSource to the DataSource I want, and then for each part, setting a Binding of DataSource = ReportItem.DataObject .  However, what I get instead, is that the entire report is repeated multiple times, one for each row in the data.  Now the query is run way more than four times!  What is going on?  Why does the solution work differently now?  Did something change in the way it works?  How do we implement this now? 
Katia
Telerik team
 answered on 21 Dec 2016
1 answer
134 views
Hello

I've design some reports in the Report Designer and they're working great, but what I need to do is to change the DB being connected to when I load the report.  The idea would be to pass a connect string to the Report Rest Service, as we already pass the filename for the report.  Is this possible?  

Thanks
Andrew
Katia
Telerik team
 answered on 21 Dec 2016
1 answer
540 views

Hi Team,

I tried to deploy htmlreport viewer to iis and when i browse for 'htmlreportviewer.asp' page.It throws an error 'jQuery undefined'.

Not sure on why the jQuery is not loading eventhough the references are pointed right.Below is my htmlreportviewer asp page

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Telerik HTML5 Report Viewer</title>
    
    <!--<script src="../js/jquery-1.9.1.min.js"></script>
    <link href="../css/kendo.common.min.css" rel="stylesheet" />
    <link href="../css/kendo.blueopal.min.css" rel="stylesheet" />
    <script src="../js/kendo.subset.2015.3.930.min.js"></script>
    <script src="../js/telerikReportViewer-10.1.16.615.min.js"></script>-->


    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <script src="../ReportViewer/js/jquery-1.9.1.min.js"></script>
    <link href="css/kendo.common.min.css" rel="stylesheet" />
    <link href="css/kendo.blueopal.min.css" rel="stylesheet" />
    <script src="../ReportViewer/js/kendo.subset.2015.3.930.min.js"></script>
    <script src="../ReportViewer/js/telerikReportViewer-10.1.16.615.min.js"></script>

    

  <style>
        #reportViewer1 {
            position: absolute;
            left: 5px;
            right: 5px;
            top: 5px;
            bottom: 5px;
            overflow: hidden;
            font-family: Verdana, Arial;
        }
    </style>
</head>
<body>

    <div id="reportViewer1">
        loading...
    </div>

    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery("#reportViewer1")
                .telerik_ReportViewer({

                    // The URL of the service which will serve reports.
                    // The URL corresponds to the name of the controller class (ReportsController).
                    // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
                    serviceUrl: "api/reports/",

                    // The URL for custom report viewer template. The template can be edited -
                    // new functionalities can be added and unneeded ones can be removed.
                    // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
                    //templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate',

                    //ReportSource - report description
                    reportSource: {
                        // The report can be set to a report file name (trdx report definition) 
                        // or CLR type name (report class definition).
                        report: "WealthTrackerReporting.Report1, WealthTrackerReporting",
                    },

                    // Specifies whether the viewer is in interactive or print preview mode.
                    // PRINT_PREVIEW - Displays the paginated report as if it is printed on paper. Interactivity is not enabled.
                    // INTERACTIVE - Displays the report in its original width and height without paging. Additionally interactivity is enabled.
                    viewMode: telerikReportViewer.ViewModes.INTERACTIVE,

                    // Sets the scale mode of the viewer.
                    // Three modes exist currently:
                    // FIT_PAGE - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
                    // FIT_PAGE_WIDTH - The report will be zoomed in or out so that the width of the screen and the width of the report match.
                    // SPECIFIC - Uses the scale to zoom in and out the report.
                    scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,

                    // Zoom in and out the report using the scale
                    // 1.0 is equal to 100%, i.e. the original size of the report
                    scale: 1.0,

                    ready: function () {
                        //this.refreshReport();
                    },
                });
        });
    </script>

</body>
</html>

 

Attached the project structure that is on iis. Please suggest.

 

Thanks,

Navatha.

Stef
Telerik team
 answered on 21 Dec 2016
5 answers
208 views
HI,
First, sorry for my english google translator.

My problem is that I'm trying to set the visibility of a subreport this by DataBinding. Except that Telerik is not updating the fields that I'm by setting the visibility, they still visible. I tried other ways, but then when I exchange their visibility to false when returns to be true, the interface fields do not return true.

Here is a piece of my code to see if you can help me.

I'm have a List

C#

I have the list, and I want the subreport becomes invisible when the list is empty.

detail is the name of the group that want to become invisible

 

 

private void subReport1_ItemDataBinding_1(object sender, EventArgs e)
        {
            var table = sender as Telerik.Reporting.Processing.SubReport;
            if (table == null) return;
 
            var group = table.DataObject.RawData as CommissionPaymentValue;
            if (group == null) return;
 
            var items = group.CommissionPaymentValueItem;
 
            detail.Visible = items.Count > 0;
 
            this.commissionPaymentValueItemReport1.Report.DataSource = items.OrderByDescending(a => a.TypeItem);
        }

 I know there are threads with the same problems, but still could not solve my.

att Lucas

Stef
Telerik team
 answered on 20 Dec 2016
2 answers
165 views

Hi,

I'm wondering if Winform Reportviewer could export Excel file (.xls) which is same format as CSV (column by column) or not. If there is no official way to do, is there any other workaround way ? Please note CSV is not the file I need

Ivan
Top achievements
Rank 1
 answered on 19 Dec 2016
3 answers
469 views

I have enabled the parameter area in the report (HTML5) and was able to render custom controls, but it is not wide enough. I want to increase the width from 15em to 22em. 

I have tried to update the css of the telerikviewer to 22em, but then the report area slides under the parameter area. I haven't found what is calculating the width of the report viewer itself. Is that done in javascript, or described in css.

Can you help me how to increase the width of the parameter area?

Stef
Telerik team
 answered on 19 Dec 2016
1 answer
60 views

Hello,

Is there any way I can express custom metadata as documentation to the user for object properties? 

I'm looking at a way to display more meaningful information in the area marked in red in the attached screenshot.

 

Best regards, 

Magnus

 

Stef
Telerik team
 answered on 19 Dec 2016
7 answers
360 views

Hi, Im trying to use overlay shape to create the style I wants, please refer to the image below

https://unsee.cc/nomugira/.

(1): is the style I want

(2): is what it is actually displaying

 

Notice also on the top left corner, it should be a red circle, but for some reason it made the whole 'design box' red, so not just the circle is red but the whole area.

 

Is there a way around this? or perhaps another way to achieve the same effect?

 

Thanks

Stef
Telerik team
 answered on 19 Dec 2016
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?