We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to supress blank rows /Tags

Hi,

We have Excel report/template. when we run report for LC and USD it should show data for LC and USD tags, when we run report for LC it should show only LC tags/Markers data and by default USD tags shows blank.

our requirement is instead of showing blank we need to suppress the USD tags/rows.

when we run for Only for USD, report must Supress LC tags.

Is there any way to achieve this with Aspose markers?

Please refer attached Excel

Hi,

Well, I am not completely sure about your need. But as far as I could understand your requirement, I think you need the irrelevant smart tags should not be preserved in the cells any more. For this you may utilize the overloaded version of the Process method e.g
WorkbookDesigner.Process(bool isPreserved) for processing the smart markers in the spreadsheet.
Simply put false for the Boolean parameter for the method.

Moreover, if you want to retain/preserve the irrelevant smart, you will put true for this parameter.

Note: Here, the irrelevant markers means the fields (in the table) you do not pick/select for your SQL query.

The sample code might be:
OleDbConnection con = new OleDbConnection(“provider=microsoft.jet.oledb.4.0;data source=d:\test\mydb.mdb”);
con.Open();
//Selecting LC data from the table only.
OleDbCommand cmd = new OleDbCommand(“Select PMLC, CoLC from Table1”,con);
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds,“Table1”);
DataTable dt = ds.Tables[“Table1”];
WorkbookDesigner wd = new WorkbookDesigner();
wd.Open(“d:\test\mytemplate.xls”);
wd.SetDataSource(dt);
wd.Process(false);
wd.Save(“d:\test\outBook1.xls”);


Thank you.