ReportView转PDF报PInvokeStackImbalance错误
在调试模式Debug运行程序,如果报表中有中文字符导出PDF会报PInvokeStackImbalance错误 ,这是一个已知错误,用Release模式执行正常,直接运行exe文件也正常,解决方法就是:不用Debug运行程序导出PDF。
微软的解释:
1.
Create a new Windows Application Project
2.
Create a new Report
3.
Add one Textbox control to the Report and type a Chinese text in the Textbox.
4.
Add ReportViewer control to Form1 and set its report to the one created in step 3 (no need to set the data sources).
5.
Run the application and attempt to export the report to PDF.