Search
Thursday, August 28, 2008 ..:: Forum ::.. Register  Login
 
  Forum  Programming  General Program...  Data is not substituted in on tags
Previous Previous
 
Next Next
New Post 1/20/2008 2:41 PM
  david
20 posts
9th Level Poster


Data is not substituted in on tags 

When I try to call my report from .Net, it basically just opens the template. it doesn't run the report and fill in any of the tags. What am i doing wrong?

string connectionString = ISymitarObject.GetConnString();

IReportDataSource data = new AdoDataSourceImpl(typeof(SqlConnection), connectionString);
KeyPairDictionary map = new KeyPairDictionary();
map.Add("transactionID", transactionID.ToString());
data.Map = map;

string templateFilePath = ISymitarObject.GetTemplateFile();
Stream template = null;
template = File.Open(templateFilePath, FileMode.Open, FileAccess.Read);

Report report = new ReportRtf(template);

report.ProcessSetup();
report.ProcessData(data, "");
report.ProcessComplete();

Response.BufferOutput = true;
Response.ContentType = "application/msword";
Response.BinaryWrite(((MemoryStream)report.GetReport()).ToArray());

report.Close();
data.Close();

 
New Post 1/20/2008 2:43 PM
  david
20 posts
9th Level Poster


Re: Data is not substituted in on tags 

I am under the assumption that you named your data source when you created your template. By default Windward Reports does not name the datasource when using only 1 data source. If you have more than 1 then you need to name each and reference each in every tag with a "datasource=DATASOURCENAME". My assumption is that you have named your datasource in your template and have datasource= attributes in your tags. A solution would be to remove the name from you datasource and remove all datasource= attributes from each tag.

report.ProcessData(data, "");

or you can pass the name in. If the name is MyData then it would be:

report.ProcessData(data, "MyData");

 
Previous Previous
 
Next Next
  Forum  Programming  General Program...  Data is not substituted in on tags
Membership Membership:
Latest New User Latest: louisedean
New Today New Today: 0
New Yesterday New Yesterday: 0
User Count Overall: 55

People Online People Online:
Visitors Visitors: 45
Members Members: 0
Total Total: 45

Online Now Online Now:
All contents copyright (c) 2002 - 2008 by Windward Studios, Inc. All Rights Reserved.   Terms Of Use  Privacy Statement