Skip to Content
0
Former Member
Oct 20, 2004 at 04:36 PM

Using an IGS Graph in Smartforms

629 Views

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
  ).