PDA

View Full Version : printing: the parameter is incorrect if not geoPrintMap



Wilfried
11-17-2005, 07:16 AM
Hi,

I'm trying to print with following code (prntDlg is a printer dialog form). The problem is in the geoPrintArea, if it is 0 (geoPrintMap) then it print ok, but any other value (1..5) gives: 'the parameter is incorrect' error. Anyone know what the problem could be ?


MP.ActivePrinter = prntDlg.SelectedPrinter.Items[prntDlg.SelectedPrin ter.SelectedIndex].ToString();
MP.ActiveMap.PrintOut("",
prntDlg.Title.Text,
(int)prntDlg.Count.Value,
(GeoPrintArea)prntDlg.GeoPrint,
(GeoPrintQuality)prntDlg.Quality,
(GeoPrintOrientation)prntDlg.Orientation,
prntDlg.Collate.Checked,
prntDlg.Legend.Checked,
prntDlg.Overview.Checked,
prntDlg.Faxable.Checked);

Winwaed
11-17-2005, 07:38 AM
Wilfried,

I've used this option before so I know it works. Have you tried the names of the enum types (geoPrintDirections, geoPrintHighlightedPlaces, geoPrintMap, geoPrintSelectedArea, geoPrintStripMaps, geoPrintTurnByTurn and geoPrintFullPage) instead?


Richard

Wilfried
11-17-2005, 07:58 AM
Hi Richard,

I tryed one of them and _yes_ it works :) Thanks. Still find it strange wy the typecast wont work. It works for all other parameters.

Joel
11-18-2005, 02:50 PM
Hi Richard,

I tryed one of them and _yes_ it works :) Thanks. Still find it strange wy the typecast wont work. It works for all other parameters.

What type of variable is GeoPrint? I'm guessing that whatever it is, isn't compatible with the cast. 0 will always cast fine. But if the cast is losing precision (or adding), then that will mess things up.

Joel

Wilfried
11-19-2005, 02:16 AM
Hi,

integer, so must be valid, but to be sure I should try it again, because this method gives 'the parameter is incorrect' error when there is a print option set that should not be there, eg route if there is no route. And by the time I asked this question I did not check for these things.