Page 1 of 1

display Connection Error while fetching data for JS

Posted: Fri Jun 12, 2020 1:33 pm
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

Re: display Connection Error while fetching data for JS

Posted: Mon Jun 15, 2020 9:09 am
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.