display Connection Error while fetching data for JS

Stimulsoft Reports.JS discussion
Post Reply
sumitparui
Posts: 3
Joined: Fri Jun 12, 2020 1:03 pm

display Connection Error while fetching data for JS

Post by sumitparui »

Hi,

I am trying to fetch data and display in designer Mode for JS Report using SQL Store procedure and parameter
when I have tried in designer Mode in Stimulsoft tools I was able to fetch the data properly
but after I published and used the same in Index file the designer report is not loading any data
it displays "Connection Error"

ConnectionString used in My Report file and the connection string used in JS are same

As mentioned in programming manual I have added below
StiOptions.WebServer.url = "http://localhost:3427/cha/stimulsoftrep ... ndler.aspx";

I have downloaded Handler.aspx and Commandjson.cs, MSSQLADapter.cs, Result.cs from giithub and added the same in My Local project
but still I am unable to solve this issue

this is my following script in Index.html

<script type="text/javascript">
function Start() {
debugger;//http://localhost:3427/cha/stimulsoftrep ... ndler.aspx


StiOptions.WebServer.url = "http://localhost:3427/cha/stimulsoftrep ... ndler.aspx";
var report = Stimulsoft.Report.StiReport.createNewReport();
report.loadFile("reports/Report.mrt");

var dbCanopusSql = report.dictionary.databases.getByName("test");
dbCanopusSql.connectionString = "Data Source=*******;Initial Catalog=*******;User ID=******;password=*****";

report.dictionary.variables.getByName("Report_FromDate").valueObject = "2019-01-04";
report.dictionary.variables.getByName("Report_ToDate").valueObject = "2020-30-03";
report.dictionary.variables.getByName("Report_CompanyId").valueObject = 35424;
report.dictionary.variables.getByName("Report_YearId").valueObject = 35;
report.dictionary.variables.getByName("Report_Client").valueObject = 0;
report.dictionary.variables.getByName("Report_Mode").valueObject = "";
report.dictionary.variables.getByName("Report_JobNo").valueObject = "";
report.dictionary.variables.getByName("Report_HouseNo").valueObject = "";
report.dictionary.variables.getByName("Report_HouseDate").valueObject = "";

var options = new Stimulsoft.Designer.StiDesignerOptions();
options.appearance.fullScreenMode = true;

var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false);

designer.onSaveReport = function (args) {
var report = args.report;
report.saveFile("reports/Report.mrt");
}

designer.report = report;
designer.renderHtml("designerContent");
}
</script>


please suggest,

Thanks
Sumit
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: display Connection Error while fetching data for JS

Post by HighAley »

Hello,

When do you get the error?
What do you see in Console?
Could you look at the Network tab. What issues do you see there?

Thank you.
Post Reply