Telerik Forums
Reporting Forum
3 answers
173 views

Hi All,
   At present l'm trying to achieve a couple of things as a mini proof of concept for a project, one l can do, the other alludes me. Reports to be created by the standalone designer, which are then dropped into a directory, where any application that needs them can change any connection strings and then load them into their respective viewers, but with all reports having no hard coded strings.

1. Create a report using the Standalone designer, then before rendering the report in a viewer have any / all SqlDatasources connection strings changed dynamically - OK (l can do this)

2. Don't have any strings in the report hard coded i.e textboxes for displaying titles, column headers etc.

I can do this by accessing the report in code, finding the appropriate item and settings its value before the report is rendered, however l would like to do this a bit more generically / the other way round; is there a way to set an item / collection on the report and then use an expression inside the standalone designer to bind say a textbox value to the an item in the collection (so it gets set at runtime), bearing in mind that the item may not have a datasource property for example a textbox that displays the name of a report on a page header.

What l would really like to do, assuming l could set a collection of say reportText objects on the report (that have a LabelText property) would be to use some sort of expression in the designer (using c# as an example)
textBoxTitle.Value = reportTextCollection.Where( item => item.controlID == "textBoxTitle").FirstOrDefault?.LabelText ?? "Default title value"
Or
textBoxTitle.Value = MyCustomExpressionAssembly.SetLabelText(controlID, reportTextCollection) // return see above

Any thoughts help appreciated, Thank you
Paul


Katia
Telerik team
 answered on 18 Oct 2016
1 answer
95 views

Hi,

 

I've put a table onto Telerik report containing more than 130 columns. When I export it as XLS and open it in Excel 2013 I get the message "Office has detected a problem with this file" and Excel starts in protected view.

When reducing the columns to max 130 the issue dosn't occur.

Is there any known problem regarding the columns count when exporting to Excel?

 

Best regards,

Rayko

Stef
Telerik team
 answered on 17 Oct 2016
1 answer
684 views

I am trying to add a telerik report and show the telerik report in telerik report viewer and wanna display the telerik report viewer when the button is click in angularjs...
but it is showing error as below.

$("#reportViewer1")
.telerik_ReportViewer({}) is not a function in AngularJS

i had updated JQuery version from jquery-1.9.1.min.js to 1.11 but again the same error occurs
How can i resolve it.. 

 

Regards

Stef
Telerik team
 answered on 17 Oct 2016
4 answers
158 views

Hi,  I want to add a rolling average to a graph as a line.  However it doesn't seem to be possible so I would be grateful for any help.  I have a graph with a category x axis of the month start date in the field settledDt, and I want to sum the last 3 months into a trend line.  Conceptually something like this:

 

= RunningValue("graph2", Sum(Fields.settledDt >= AddNonths(-2, Max(Fields.settledDt)) ? Fields.initial_total : Null))

What I'm trying to say here is if the month is within the last 3 in the RunningValue, then include initial_total in the sum, but of course this expression is invalid due to the nested aggregate.  My reports are all in trdx format with no code, so a no code solution is what I'd like.

 

Thanks,

Scott Waye
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 15 Oct 2016
1 answer
158 views

We have a report that can get to be very large, with some 10,000 rows. When we try to display it in a browser, the first page, which is the group header section containing heading information, renders fine. The second page, which is the group footer section containing the 10,000+ rows of detail, always hangs, and we only see a blank page. 

There is no way to limit the number of records returned. Our customers will want to see the entire report, and be able to look through it. How do we get it to display?

Katia
Telerik team
 answered on 14 Oct 2016
3 answers
67 views

Hi,

Say there us a detailed section and on top of it several headers in textBoxes and below - a table.
When the report is rendered into ReportViewer the text boxes are on one page and the table on second..
Between them a lot of unused space..

Tried KeepTogether, Groupping without success.. Even tried Anchor..

Always the table in that section begins from second page.. it is filled.. if i's empty, then yes, it's drawn right below the text boxes.

 

How to keep he table to be rendered right below the text boxes?

Роберт
Top achievements
Rank 1
 answered on 14 Oct 2016
1 answer
190 views

Hi, My Html Code is:

   <div kendo-grid="vm.grid" id="grid" k-data-source="vm.gridOptions.datasource" k-options="vm.gridOptions" class="lm-panel-body">
    </div>

 

And My Js file code in AngularJs is:

---------------------------------------------------

vm.getGridOptions = function () {
            vm.gridOptions = {
                datasource: new kendo.data.DataSource({
                    type: "odata",
                    transport: {
                        read: function (options) {
                            if (!!$scope.figure.figureId) {
                                if (!!options.data.filter) {
                                    $scope.filterChanged(vm.gridOptions.datasource, vm.getFigureData.dataSource.name);
                                    if (options.data.filter.filters != null) {
                                        for (var i = 0; i < options.data.filter.filters.length; i++) {
                                            if (options.data.filter.filters[i].value.indexOf("00:00:00") > -1) {
                                                var date = new Date(options.data.filter.filters[i].value);
                                                var month = ("0" + (date.getMonth() + 1)).slice(-2);
                                                var day = ("0" + date.getDate()).slice(-2);
                                                var fullDate = date.getFullYear() + "/" + month + "/" + day;
                                                options.data.filter.filters[i].value = fullDate;
                                            }
                                        }
                                    }
                                }
                                else if (!options.data.filter)
                                {
                                    $scope.filterChanged(undefined, vm.getFigureData.dataSource.name);
                                }
                                gridService.get(options, $scope.figure.figureId).then(function (data) {
                                });
                            }
                        }
                    },
                    schema: {
                        data: function (data) {
                            if (data.data) {
                                return data.data;
                            }
                        },
                        total: function (data) {
                            if (data.total) {
                                return data.total;
                            }
                        }
                    },
                    group: vm.JsonGroupingCloumns,
                    aggregate: vm.aggregatesList,
                    pageSize: vm.gridConfigurationJson.PageSize ? vm.gridConfigurationJson.PageSize : 10,
                    serverPaging: true,
                    serverSorting: true,
                    serverFiltering: true
                }),
                dataBound: function (e) {
                    if (vm.childGridId > 0 && vm.detailGridFigureParams == undefined) {
                        this.expandRow(this.tbody.find("tr.k-master-row").first());
                        this.collapseRow(this.tbody.find("tr.k-master-row").first());
                    }
                    if (e.sender.pager.dataSource._pageSize != 10) {
                        if (vm.gridConfigurationJson.PageSize != e.sender.pager.dataSource._pageSize) {
                            saveGridConfigration(e, $scope.figure.figureId);
                        }
                    }
                },
                sortable: {
                    mode: "single",
                    allowUnsort: false
                },
                pageable: {
                    refresh: true,
                    pageSizes: [10, 25, 50, 100, 200, "All"],
                    buttonCount: 5,
                },
                filterable:true,
                scrollable: true,
                resizable: true,
                reorderable: true,
                columnMenu: true,
                columns: vm.columnsList,
                excel: {
                    allPages: true,
                    filterable: true
                },
                excelExport: function (e) {
                    var filename = "";
                    if ($scope.figure.captionView != undefined) {
                        filename = $scope.figure.captionView;
                    }
                    else if ($scope.figure.caption != undefined) {
                        filename = $scope.figure.caption;
                    }
                    if (vm.childGridId > 0)
                    {
                        e.preventDefault();
                        var workbook = e.workbook;

                        detailExportPromises = [];
                        
                        var masterData = e.data;

                        if (masterData != null) {
                            for (var rowIndex = 0; rowIndex < masterData.length; rowIndex++) {
                                var masterRowData = {};
                                masterRowData.data = masterData[rowIndex];
                                exportChildData(rowIndex, masterRowData);
                            }
                        }

                        $.when.apply(null, detailExportPromises)
                                   .then(function () {
                                       // get the export results
                                       var detailExports = $.makeArray(arguments);

                                       // sort by masterRowIndex
                                       detailExports.sort(function (a, b) {
                                           return a.masterRowIndex - b.masterRowIndex;
                                       });

                                       //// add an empty column
                                       workbook.sheets[0].columns.unshift({
                                           width: 30
                                       });

                                       // prepend an empty cell to each row
                                       for (var i = 0; i < workbook.sheets[0].rows.length; i++) {
                                           workbook.sheets[0].rows[i].cells.unshift({});
                                       }

                                       // merge the detail export sheet rows with the master sheet rows
                                       // loop backwards so the masterRowIndex doesn't need to be updated
                                       for (var i = detailExports.length - 1; i >= 0; i--) {
                                           var masterRowIndex = detailExports[i].masterRowIndex + 1; // compensate for the header row

                                           var sheet = detailExports[i].sheet;

                                           // prepend an empty cell to each row
                                           for (var ci = 0; ci < sheet.rows.length; ci++) {
                                               if (sheet.rows[ci].cells[1].value) {
                                                   sheet.rows[ci].cells.unshift({});
                                               }
                                           }

                                           // insert the detail sheet rows after the master row
                                           [].splice.apply(workbook.sheets[0].rows, [masterRowIndex + 1, 0].concat(sheet.rows));
                                       }

                                       // save the workbook

                                       kendo.saveAs({
                                           dataURI: new kendo.ooxml.Workbook(workbook).toDataURL(),
                                           fileName: filename + ".xlsx"
                                       });
                                   });
                    }else
                    {
                       e.workbook.fileName = filename + ".xlsx";
                    }
                },
                //pdf: {
                //    allPages: true,
                //    fileName: $scope.vm.getFigureData.caption + ".pdf"
                //},
                columnReorder: function (e) {
                    saveGridConfigration(e,$scope.figure.figureId);
                },
                columnResize: function (e) {
                    saveGridConfigration(e,$scope.figure.figureId);
                }
            };
            if (vm.childSourceChecked == 1) {
            if (vm.childGridId > 0) {
                    vm.gridOptions.detailInit = detailInit;
                }
                vm.childSourceChecked = 2;
            }
            var clearFilterTemplate = $("#clearFilterButtonTemplate").html();
            if(clearFilterTemplate)
            {
                vm.gridOptions.toolbar = [
                    "excel",
                    { text: "Clear filter", template: kendo.template($("#clearFilterButtonTemplate").html()) }
                ]
            }

        };

Error is Google Chrome :

lib-0fb5682e33.js:5 TypeError: Cannot read property 'length' of undefined
    at Function.map (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:1:12661)
    at init.toDataURL (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:24:1105)
    at init.<anonymous> (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:24:9157)
    at Object.r (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:1:12947)
    at Object.<anonymous> (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:2:4784)
    at u (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:2:3416)
    at Object.fireWith [as resolveWith] (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:2:4228)
    at Object.r.(anonymous function) [as resolve] (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:2:5208)
    at init.<anonymous> (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:24:3882)
    at Object.r (http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:1:12947)

 

Error in Firefox is:

Error: e is undefined
.map@http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:1:12658
z<.toDataURL@http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:24:1103
t.ExcelMixin.saveAsExcel/<@http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:24:9155
.proxy/r@http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:1:12945
.Deferred/i.then/</</<@http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:2:4782
J.Callbacks/u@http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:2:3411
J.Callbacks/d.fireWith@http://lm.stage.cargoclix.net/js/lib-0fb5682e33.js:2:4228

Katia
Telerik team
 answered on 14 Oct 2016
0 answers
65 views
Help...
How and where can I place a condition for a particular detail record does not appear in print? My report is setted to a query, but when printing certain record depend on a condition in the records, do not know how to ...
I look forward, grateful

Antonio Carlos
Antonio Carlos
Top achievements
Rank 1
 asked on 13 Oct 2016
3 answers
978 views

We have several reports where we are not using the detail section, and we put tables in the header or footer. When we export to csv, we get one line of data containing the customer name and other variable data that goes in the header, but the table data does not export.

We do have one report that has the table in the detail section. Oddly, that table does export, but the customer name and other header data does not.

Now I should point out that when we design our reports, we do not use a data source. We type in the column names manually, as in:

=Fields.FieldName

The reports get their data from a web service, and we then bind it to the report and render it in the report viewer. I don't know if that has any effect on this issue or not.

PDF and Excel work fine.

Is there any way we can get all the data to export?

 

Katia
Telerik team
 answered on 13 Oct 2016
3 answers
166 views

Hello - I am trying to use the Report Catalog sample and instead of setting the "View Report" text box Action to Navigate To Report directly I am trying to use this to run a Report Book, which can contain multiple reports.  Everything seems to connect up correctly but when I run the Report Viewer the Text Box is not clickable.  I can set it directly to the report assembly name and it works fine but when I try to use the User Function for the Report Book it doesn't allow clicking.  What could possibly be wrong?

Here is a sample of the function:

Public Function BuildReport(ReportName As String) As InstanceReportSource     Dim reportSource As New Telerik.Reporting.InstanceReportSource     Dim reportBook As New ReportBook     reportBook.Reports.Add(New CoverSheet)     If ReportName = "Acknowledgement" Then         reportBook.Reports.Add(New Acknowledgement)     ElseIf ReportName = "Window Schedule" Then         reportBook.Reports.Add(New WindowSchedule)     End If     reportBook.Reports.Add(New SignOffLetter)     reportSource.ReportDocument = reportBook     Return reportSource End Function

Stef
Telerik team
 answered on 13 Oct 2016
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?