本文介绍了如何通过操作来自Web应用程序界面的用户输入来过滤水晶报表中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用户在Web应用程序界面中输入输入,但我没有在db中保存这些值...我想通过控制器或报告生成器get-report()方法将这些值传递给crystal report的参数字段。例如用户输入日期范围,它操纵控制器方法中的所有日期输入,并在水晶报告上显示过滤数据。



我尝试过:



i相应地格式化了水晶报告...过滤器或参数字段对于报告查看器工作正常但我无论如何都无法获得用户输入和设置 - 控制器方法中的参数相应...

任何帮助?????

I am taking the inputs by user in web application interface but I am not saving these values in db... I want to pass these values to parameters field of crystal report through controller or report generator get-report() method. for-example user inputs date-range and its manipulates all date inputs in controller method and displays filtered data on crystal report.

What I have tried:

i have formatted crystal report accordingly... filters or parameter fields are working fine for report viewer but i am not getting anyway to get user input and set-parameters in controller method accordingly...
any help ?????

推荐答案

if(rptDoc.DataDefinition.ParameterFields.Count > 0)
{
    foreach(ParameterFieldDefinition crDef in rptDoc.DataDefinition.ParameterFields)
    {
    // Check for empty report name
    // Sub Reports will have a value, Main Report does not
    // Sub Report Parameters are passed by the Main Report
        if(crDef.ReportName == string.Empty)
        {
            object objValue = "What ever value I want to use";
            rptDoc.SetParameterValue(crDef.ParameterFieldName, objValue);
        }
    }
}



然后你可以运行报告&在WebViewer中显示或导出到流并以PDF / Word / Excel等格式返回



亲切的问候


You can then run the report & show in a WebViewer or export to a stream and return as a PDF/Word/Excel etc

Kind Regards


这篇关于如何通过操作来自Web应用程序界面的用户输入来过滤水晶报表中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 17:50