Page 5 of 7

Re: DateTime Format Issue

Posted: Thu Feb 16, 2017 5:19 pm
by BCS
Worked like a charm, thank you very much.

If I wanted to specify a specific page (emulating the textbox with current page #), would be a long the same lines but with "GoToPage" or how would that look

Re: DateTime Format Issue

Posted: Fri Feb 17, 2017 2:27 pm
by HighAley
Hello.

It need more code to call the GoToPage.
We need some time to prepare a sample for you.

Thank you.

Re: DateTime Format Issue

Posted: Fri Feb 17, 2017 2:53 pm
by BCS
Sure thing, appreciate the help to my barrage of questions.

Your example will probably include this part but, I'm also trying to make a call to:

Code: Select all

viewer.jsObject.reportParams.pageCount
for the total page count but it always writes a zero, however in the console when logged it shows the correct value

I've also tried

Code: Select all

report.pages.count
as well as

Code: Select all

report.renderedPages.count

Re: DateTime Format Issue

Posted: Mon Feb 20, 2017 12:55 pm
by HighAley
Hello

Here is the code of the GoToPage action:

Code: Select all

viewer.jsObject.reportParams.pageNumber = pageNumber; //first page number 0
viewer.jsObject.postAjax(
    viewer.jsObject.options.requestUrl.replace("{action}", viewer.jsObject.options.actions.viewerEvent),
   { action: "GetPages" },
   viewer.jsObject.showReportPage);
Thank you.

Re: DateTime Format Issue

Posted: Tue Feb 21, 2017 6:17 am
by BCS
This worked fine, thank you again, however making the call to

Code: Select all

viewer.jsObject.reportParams.pagesCount
is always showing zero. If I console log that code and also log

Code: Select all

viewer.jsObject.reportParams
you can see the correct number of pages for reportParams but not for pagesCount.

Code: Select all

console.log(viewer.jsObject.reportParams);
console.log("Page Count: " + viewer.jsObject.reportParams.pagesCount);
Screenshot at Feb 20 12-45-38.png
Screenshot at Feb 20 12-45-38.png (50.06 KiB) Viewed 6784 times

Re: DateTime Format Issue

Posted: Thu Feb 23, 2017 8:59 am
by HighAley
Hello.

When do you check the pagesCount?
Maybe there is no information about the count of pages at this moment?

Thank you.

Re: DateTime Format Issue

Posted: Thu Feb 23, 2017 4:22 pm
by BCS
Screenshot from previous post is where those console logs are

Code: Select all

     $.ajax({
                type: 'GET',
                url: "url/to/data",
                dataType: 'json',
                contentType: 'application/json',
                data:
                    {
                        'start' : moment(start).format('YYYY-MM-DD'),
                        'end' : moment(end).format('YYYY-MM-DD')
                    },

                success: function(d) {
                    if(d.count != 0) {
                        var dataSet = new Stimulsoft.System.Data.DataSet("DataSet");

                        viewer = new Stimulsoft.Viewer.StiViewer(options, "viewerContent", false);

                        report.loadFile('Report.mrt'));
                        report.dictionary.databases.clear();
                        dataSet.readJson(d);
                        report.regData(dataSet.dataSetName, "", dataSet);
                        report.dictionary.synchronize();
                        viewer.report = report;
                        viewer.renderHtml("viewerContent");
                    }
                    else {
                        viewer = new Stimulsoft.Viewer.StiViewer(options, "viewerContent", false);

                        viewer.report = null;
                        viewer.renderHtml("viewerContent");
                    }
                },

                failure: function(errMsg) {
                    
                }
            }).done(function(data) {
                        //page count would be called here
                        console.log(viewer.jsObject.reportParams);
                        console.log("Page Count: " + viewer.jsObject.reportParams.pagesCount);
            });

Re: DateTime Format Issue

Posted: Fri Feb 24, 2017 3:39 pm
by HighAley
Hello.

Please, try to call the render() method.

Code: Select all

report.dictionary.synchronize();
report.render();
viewer.report = report;
Thank you.

Re: DateTime Format Issue

Posted: Fri Feb 24, 2017 7:26 pm
by BCS
If I make those changes, nothing is render at all, I have a div where the report is to rendered.

Re: DateTime Format Issue

Posted: Mon Feb 27, 2017 1:00 pm
by HighAley
Hello.

Lets try again.
If you need to know the Number of Pages of the rendered report, you could render the report and get the number of rendered pages.
When you get it from the viewer.jsObject.reportParams.pagesCount, it seems that there is no such information yet.

Thank you.