Я пытаюсь создать PDF из отчета Access. Всплывающее диалоговое окно отчета «Введите значение параметра». Как я мог заполнить это с C #? Это даже тот параметр reportParameter (whereCondition)?
using System;
using MsAccess = Microsoft.Office.Interop.Access;
namespace mdb2pdf
{
class Program
{
public static void Main(string[] args)
{
string MDBFile = @"d:\example.mdb";
string PDFFile = @"d:\example.pdf";
string reportName = @"myReport";
string reportParameter = @"[Name?] LIKE 'myName'";
MsAccess.Application app = new MsAccess.Application();
app.OpenCurrentDatabase(MDBFile, false, "");
app.DoCmd.OpenReport(reportName, Microsoft.Office.Interop.Access.AcView.acViewPreview, Type.Missing, reportParameter, MsAccess.AcWindowMode.acWindowNormal, Type.Missing);
app.DoCmd.OutputTo(MsAccess.AcOutputObjectType.acOutputReport, reportName, MsAccess.Constants.acFormatPDF, PDFFile, Type.Missing, Type.Missing, Type.Missing);
app.CloseCurrentDatabase();
}
}
}