Hello.
This is how you would use a C# form application for
Command Line Replacements.
You will need to replace the variables in this code to work with your .rrd of course.
Keep in mind, “PRINTER_NAME” is the variable of the printer you chose in your .RRD (In this case, it was %PRINTER_NAME% )
string LogicityDesktopPath = @"C:\Program Files\SaberLogic\Logicity\Logicity Desktop.exe";
string RRDPath = @"<LOCATION OF RRD FILE>";
private void bttnReports_Click(System.Object sender, System.EventArgs e)
{
// Check path to Logicity Desktop
System.IO.FileInfo logicityPath = new System.IO.FileInfo(LogicityDesktopPath);
if (logicityPath.Exists == false)
{
MessageBox.Show("Logicity Desktop is not installed at " + LogicityDesktopPath + ". Please check the application configuration file.");
return;
}
// Check path to RRD
System.IO.FileInfo rrdPath = new System.IO.FileInfo(RRDPath);
if (rrdPath.Exists == false)
{
MessageBox.Show("RRD is not installed at " + RRDPath + ". Please check the application configuration file.");
return;
}
System.Diagnostics.ProcessStartInfo startInfo = null;
System.Diagnostics.Process pStart = new System.Diagnostics.Process();
startInfo = new System.Diagnostics.ProcessStartInfo(LogicityDesktopPath, "\"" + RRDPath + "\"" + " PRINTER_NAME=<PRINTER NAME HERE>");
pStart.StartInfo = startInfo;
try
{
pStart.Start();
}
catch (Exception ex)
{
// Display error
MessageBox.Show("Error: " + ex.ToString());
}
}
I hope this works for you!
- Devin Ellis