Connect Reports
Contents
Once a trip’s route has been calculated, PC*Miler Connect generates four reports: a Mileage report, a Detailed report, a State/Country report, and a Driver’s report. The reports are returned in tab delimited lines which allow easy pasting into spreadsheets, list boxes, and grids.
You can retrieve reports showing the route’s information using the following functions:
- PCMSGetRptLine retrieves a specified report, line by line.
- PCMSNumRptLines gets the number of lines in a specified report.
- PCMSGetRpt retrieves up to 64K bytes of a report (more in 32-bit) at once.
- PCMSNumRptBytes gets the number of bytes contained in a specified report.
- PCMSGetHTMLRpt returns a text buffer containing the specified report formatted as HTML.
- PCMSNumHTMLRptBytes returns the number of bytes in the HTML-formatted report.
- PCMSGetSegment gets a report segment, which is a single line from a Detailed Report.
- PCMSGetNumSegments gets the number of report segments in the Detailed Report.
- PCMSSetAccessRule can be used to turn off warnings that appear in the Detailed and Driver’s reports.
Two ways to retrieve a report:
char buf[20000];
int lines;
/* Show detailed driving instruction for route */
/* Index lines from 0. Buffer must be > 100 char */
lines = PCMSNumRptLines(pracTrip, RPT_DETAIL);
for (i=0; i < lines; i++)
{
PCMSGetRptLine(pracTrip, RPT_DETAIL, i, buf, 100);
printf("%s\n", buf);
}
/* Get state by state mileage breakdown report */
length = PCMSNumRptBytes(pracTrip, RPT_STATE);
PCMSGetRpt(pracTrip, RPT_STATE, buf, 20000);
printf("The entire state report:\n%s\n", buf);
Trip Leg Information
PC*Miler Connect includes functions that can pull information from specific legs of a route. To use the following functions, check that the compiler’s option for data alignment is set to byte alignment.
- PCMSNumLegs returns the number of calculated legs in a trip.
- PCMSGetLegInfo gets the leg information in a trip, including time, cost, and distance.
Sample code to retrieve leg information
int legNum;
int i;
struct legInfoType pLegInfo;
int numLegs = PCMSGetNumLegs();
for(i = 0; i < numLegs; i++)
PCMSGetLegInfo(trip, legNum, &pLegInfo);