set report sql select command

i am using fastreport : (FastReport.OpenSource.Data.SQLite)
when i am try to change select command through :

TableDataSource table = report.GetDataSource("Table") as TableDataSource;
table.SelectCommand = "Select * from Customers"; // CustCode,CustName,CustAddress,CTel,Job,Remarks,....
MemoryStream stream = new MemoryStream();
try
{

Config.WebMode = true;
using (report)
{
report.ConvertNulls = true;
report.Prepare();
HTMLExport export = new HTMLExport();
export.Layers = true;
export.EmbedPictures = true;
export.Export(report, stream);
stream.Flush();
}
mime = "text/html";// + query.Format; // Override mime for html
return File(stream.ToArray(), mime, MvarReportFileName);
}
catch (Exception ex)
{
//{System.Exception: Text30: Error in expression: Table.CustAddress at FastReport.TextObjectBase.CalcAndFormatExpression(String expression, Int32 expressionIndex) at FastReport.TextObject.GetData() ...
return File(stream.ToArray(), mime);
}
i got the following error When Field CustAddress is null :
System.Exception: Text30: Error in expression: Table.CustAddress at FastReport.TextObjectBase.CalcAndFormatExpression(String expression, Int32 expressionIndex) at FastReport.TextObject.GetData() ...

if i change the select statement to "select CustCode,CustName,ifnull(CustAddress,'') as CustAddress erorr disappeared
the error comes when certain field has null value , even if i set report.ConvertNulls=true
do you have easy solution other than ifnull function to set the null database field to space ???

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.