This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Using a method to generate a report always yields a blank <body></body>

guyIncognito - Tuesday, January 12, 2010 11:27 AM:

Hi,

I'm trying to use a C# method to generate the contents of a report, but something isn't working out.

The report worked fine when I originally developed it as a report_query xsl_stylesheet pair.  I assumed loading the report_query in a C# method, applying it, and then applying the xsl_stylesheet to the result would give me the same output... but it doesn't.

I get a report back, with all the trimmings (html, head, and script tags correctly filled) but with a blank <body></body>.

I checked the result of my method by debugging in VS and the content of my result item is 100% correct with a filled <body></body>.

It seems that between the result of my method and the displaying of the report everything between the <body></body> tags is lost.  Does anyone know what I'm doing wrong?

Here's my method:

Innovator inn = this.getInnovator();

String reportName = this.getProperty("report_name");
Item report = inn.getItemByKeyedName("Report", reportName);

if (report.getItemCount() < 1)
{
	return inn.newError("Could not retrieve report " + reportName + "");
}

Item reportQuery = inn.newItem();
reportQuery.loadAML(report.getProperty("report_query"));
string xslStylesheet = report.getProperty("xsl_stylesheet");

Item reportQueryResult = reportQuery.apply();
string resultString = reportQueryResult.applyStylesheet(xslStylesheet, "text");

return inn.newResult(resultString);


Pravin Kumar - Wednesday, October 10, 2012 4:44 PM:

Hi There,

Were you able to resolve this issue?. I have a similar problem where I am unable to view the data on the report, I get the ouput with blank data but i see the table columns defined within the style sheet. Placing the same query inside the report_query section (replaced the dynamic criteria with hardcoded parameters) with the same stylesheet on a Report item, it just works fine!.

I have a client side method that generates the dynamic query for the Report item. The pseducode for this method is as follows:

var innovator = this.getInnovator();
var XYZ = innovator.newItem();
//Construct AML and apply
var qryString="";
XYZ .loadAML(qryString);
//Get the query results
var results = XYZ .apply();
//Attach the query with the Report item that contains the stylesheet
var report = innovator.getItemByKeyedName("Report","REPORTNAME");
var style = report.getProperty("xsl_stylesheet");
var html = results .applyStylesheet(style,"text");
return html;
Appreciate any insights.

Cheers,
Pravin