10-20-2004 5:36 PM
Hi All,
I want to use an IGS produced graph inside a smart form (for invoice billing purposes), and have run into a problem.
When I use the code below, I get the graph in a raw table, but the graph produced from IGS is in GIF format.
The only way I know to use it in smartforms, is to have it in TIF or BMP format (as I can't seem to convert a GIF file into a form graphic).
Does anyone know either:
a) How to get IGS to produce a TIF or BMP image? or
b) How to convert and upload a GIF into the form graphic library without using an external tool?
Regards,
Matt
Example calling of IGS to produce bar graph
DATA:
WTBL_GRAPH_DATA type IGS_DATA_TAB,
wstr_igs_data TYPE igs_data,
wo_igs_chart type ref to cl_igs_chart.
wc_content_type type w3param-cont_type,
wi_content_length type w3param-cont_len,
wtbl_content type w3mimetabtype,
wc_msg(80) type c.
wstr_igs_data-groupid = 'Water'.
* create dummy data
wstr_igs_data-y = 10.
wstr_igs_data-x = 'January'.
append wstr_igs_data to wtbl_graph_data.
wstr_igs_data-y = 20.
wstr_igs_data-x = 'February'.
append wstr_igs_data to wtbl_graph_data.
wstr_igs_data-y = 30.
wstr_igs_data-x = 'March'.
append wstr_igs_data to wtbl_graph_data.
wstr_igs_data-y = 40.
wstr_igs_data-x = 'April'.
append wstr_igs_data to wtbl_graph_data.
create object wo_igs_chart.
wo_igs_chart->type = 'COLS_3D'.
wo_igs_chart->width = '400'.
wo_igs_chart->height = '300'.
wo_igs_chart->title = 'Test Graph'.
wo_igs_chart->title_categories = 'Billing date'.
wo_igs_chart->title_values = 'Consumption (KWH)'.
wo_igs_chart->color_scheme = cl_igs_chart=>co_scheme_default.
wo_igs_chart->legend = cl_igs_chart=>co_legend_default.
wo_igs_chart->data = ITBL_GRAPH_DATA.
wo_igs_chart->send(
importing
content_type = wc_content_type
content_length = wi_content_length
content = wtbl_content
msg_text = wc_msg
exceptions
others = 1
).
10-21-2004 9:35 AM
Hi,
what about using the new chart engine (XMLCHART) of the IGS? With 6.20 you can use the class CL_IGS_CHART_ENGINE that provides several picture formats (GIF, JPG, PNG, WBMP, BMP, SVG).
As an alternative you could also send your GIF back to the IGS and request the image converter to return a BMP. But due to the additional round trip this doesn't seem to be the best solution. The image converter is available as CL_IGS_IMAGE_CONVERTER (6.40).
Kai
10-25-2004 6:18 PM
Looks like my version of 6.20 doesn't have CL_IGS_CHART_ENGINE (and of course doesn't have CL_IG_IMAGE_CONVERTER). So sounds like a very good solution in the future, but not in the current release we're using.
Thanks for the information Kai.