i three checkbox
1-id
2-name
3-address
when user select column when select checbox address report then show only field address
or select id,name show report only field id , name
thanks
Code: Select all
StiReport report = new StiReport();
report.Load(@"E:\SampleSelectingColumnsReport.mrt");
StiText textProductID = report.GetComponents()["textProductID"] as StiText;
textProductID.Enabled = true;
StiText textProductName = report.GetComponents()["textProductName"] as StiText;
textProductName.Enabled = false;
StiText textSupplierID = report.GetComponents()["textSupplierID"] as StiText;
textSupplierID.Enabled = true;
StiText textCategoryID = report.GetComponents()["textCategoryID"] as StiText;
textCategoryID.Enabled = false;
StiText textQuantityPerUnit = report.GetComponents()["textQuantityPerUnit"] as StiText;
textQuantityPerUnit.Enabled = false;
StiText textUnitPrice = report.GetComponents()["textUnitPrice"] as StiText;
textUnitPrice.Enabled = false;
StiText textUnitsInStock = report.GetComponents()["textUnitsInStock"] as StiText;
textUnitsInStock.Enabled = true;
double width = 0;
StiDataBand DataBand1 = report.GetComponents()["DataBand1"] as StiDataBand;
foreach (StiComponent comp in DataBand1.Components)
{
if (comp.Enabled) width += comp.Width;
}
double factor = width / DataBand1.Width;
foreach (StiComponent comp in DataBand1.Components)
{
if (comp.Enabled) comp.Width /= factor;
}
report.Show();
Code: Select all
StiHeaderBand h = stiReport2.GetComponents()["HeaderDataSource1"] as StiHeaderBand ;
foreach (StiComponent comp in h.Components)
{
if (comp.Enabled) comp.Width /= factor;
}
Code: Select all
StiReport report = new StiReport();
report.Load(@"E:\SampleSelectingColumnsReport.mrt");
StiText textProductID = report.GetComponents()["textProductID"] as StiText;
StiText headerProductID = report.GetComponents()["headerCategoryID"] as StiText;
textProductID.Enabled = true;
headerProductID.Enabled = true;
StiText textProductName = report.GetComponents()["textProductName"] as StiText;
StiText headerProductName = report.GetComponents()["headerProductName"] as StiText;
textProductName.Enabled = false;
headerProductName.Enabled = false;
StiText textSupplierID = report.GetComponents()["textSupplierID"] as StiText;
StiText headerSupplierID = report.GetComponents()["headerSupplierID"] as StiText;
textSupplierID.Enabled = true;
headerSupplierID.Enabled = true;
StiText textCategoryID = report.GetComponents()["textCategoryID"] as StiText;
StiText headerCategoryID = report.GetComponents()["headerCategoryID"] as StiText;
textCategoryID.Enabled = false;
headerCategoryID.Enabled = false;
StiText textQuantityPerUnit = report.GetComponents()["textQuantityPerUnit"] as StiText;
StiText headerQuantityPerUnit = report.GetComponents()["headerQuantityPerUnit"] as StiText;
textQuantityPerUnit.Enabled = false;
headerQuantityPerUnit.Enabled = false;
StiText textUnitPrice = report.GetComponents()["textUnitPrice"] as StiText;
StiText headerUnitPrice = report.GetComponents()["headerUnitPrice"] as StiText;
textUnitPrice.Enabled = false;
headerUnitPrice.Enabled = false;
StiText textUnitsInStock = report.GetComponents()["textUnitsInStock"] as StiText;
StiText headerUnitsInStock = report.GetComponents()["headerUnitsInStock"] as StiText;
textUnitsInStock.Enabled = true;
headerUnitsInStock.Enabled = true;
double width = 0;
StiDataBand DataBand1 = report.GetComponents()["DataBand1"] as StiDataBand;
foreach (StiComponent comp in DataBand1.Components)
{
if (comp.Enabled) width += comp.Width;
}
double factor = width / DataBand1.Width;
foreach (StiComponent comp in DataBand1.Components)
{
if (comp.Enabled) comp.Width /= factor;
}
StiHeaderBand HeaderBand1 = report.GetComponents()["HeaderBand1"] as StiHeaderBand;
foreach (StiComponent comp in HeaderBand1.Components)
{
if (comp.Enabled) comp.Width /= factor;
}
report.Show();
Code: Select all
double width = 0;
StiDataBand DataBand1 = report.GetComponents()["DataBand1"] as StiDataBand;
foreach (StiComponent comp in DataBand1.Components)
{
if (comp.Enabled) width += comp.Width;
}
double factor = width / DataBand1.Width;
foreach (StiComponent comp in DataBand1.Components)
{
if (comp.Enabled) comp.Width /= factor;
}
StiHeaderBand HeaderBand1 = report.GetComponents()["HeaderBand1"] as StiHeaderBand;
foreach (StiComponent comp in HeaderBand1.Components)
{
if (comp.Enabled) comp.Width /= factor;
}