Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook



The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic

Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.

If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.

Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.

Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

dynamically setting report bitmap image file pointer

  • Filter
  • Time
  • Show
Clear All
new posts

  • dynamically setting report bitmap image file pointer

    I have a quoting system for international sales. I have 2 Price Schedule reports, one for metric and one for SAE, that contain 36 bitmap objects for the currency symbol the user selects in the sequence of generating a Price Schedule report. The bitmap objects are named "bitmap_01" through "bitmap_36". This is a multiple user app, so I have a folder - USERS - containing subfolders named for each user (their system login username), each containing a file named - currency_symbol.bmp. When the user selects the country for the currency symbol for the report, the selected country's currency symbol is copied to their folder file - currency_symbol.bmp. The literal filename currently for all 36 bitmap objects on the reports is [PathAlias.ADB_Path]\Currency_symbol.bmp. This points to a dummy file so the report has a file to "see" when it is opened, otherwise an error fires. Then I have the report OnPrintInit event loop through each bitmap object on the report and change the the filename pointer to the users currency file using the following UDF:

    FUNCTION proj_prcs_rprt_bmp_set AS C (report_type as C)
    ' This function contains the parameter for the report type , either metric or SAE
    ' This allows for any variances in the number of BMP objects between the report types if needed later 
    ' This addresses the proper number of BMP_xx objects within the specific report and 
    '   dynamically changes  the report bmp object filenames to be pointed to the selected
    '   USER\currency_symbol.bmp image through the global variable vg_rep_curr_symbl_file 
    '   created in the Price Schedule sequence calling script - currency_select_dlg()
    	dim vn_bmp_count as n
    	dim vbmpw as C
    	dim vreport as C
    	if report_type="SAE"
    	end if
    	for i = 1 to vn_bmp_count
    		evaluate_template(":"+vreport+":Bitmap_"+vbmpw+".bitmap.filename = "+quote(vg_rep_curr_symbl_file))
    This works fine, so far, but i have these questions:
    1) in multiuser environment, will there be a conflict with the report pointing the bmp files to a common dummy bmp file when two users simultaneously open the same report?
    2) Is there a more robust, easier, more elegant-preferable method to accomplish this?

    Mike W
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  • #2
    Re: dynamically setting report bitmap image file pointer


    What if, instead of doing it on the onprintinit, you do a file copy BEFORE you run the report. I and guessing you initiate the report from a button. In that script, do a file.copy from the currency bitmap to the dummy bitmap within the user's folder.



    • #3
      Re: dynamically setting report bitmap image file pointer

      that is what happens. the report bitmaps can only point to one file, and the path for each user folder is different.
      Mike W
      "I rebel in at least small things to express to the world that I have not completely surrendered"


      • #4
        Re: dynamically setting report bitmap image file pointer

        What I'm saying is to copy the country currency bitmap into the specific user folder and name it the generic bitmap name. The report points to that file, which should have been initialized to the appropriate currency by the script BEFORE the print is initiated.

        I'm not in the office now, but tomorrow, I'll give an example of what we do to display specific photos and signatures in an on_fetch event of a form.



        • #5
          Re: dynamically setting report bitmap image file pointer


          We print employee badges using photos and signatures captured into .jpg images on one of our servers.

          On each badge, there are 2 bitmap fields 1 for the photo and 1 for the signature.
          When we go to print the badges, we use the on_print_inti event to make sure we have the appropriate photo and badge. this is the code:

          'Date Created: 15-Mar-2005 04:04:52 PM
          'Last Updated: 12-Mar-2012 03:00:03 PM
          'Created By  : Tom Henkel
          'Updated By  : Thomas Henkel
          dim global badgeno as N
          dim filename1 as C
          filename1 = "G:\bcbss\PHOTO"+CHR(92)+alltrim(str(BADGENO))+".JPG"
          sigfile = "S:"+CHR(92)+alltrim(str(BADGENO))+"s.JPG"
          IF FILE.EXISTS(filename1)
          	bitmap6.bitmap.filename = filename1
            	bitmap6.bitmap.filename = "G:\bcbss\photo\not_avail.jpg"
          END IF
          IF FILE.EXISTS(sigfile)
          	bitmap1.bitmap.filename = sigfile
            	bitmap1.bitmap.filename = "G:\bcbss\PHOTO\blanksig.jpg"
          END IF
          Bitmap 6 is the photo and bitmap1 is the signature. If we don't find either we set the bitmap field to a default. the default is set to a blank image file.

          This is the layout:

          Hopefully this will help.

          Last edited by Tom Henkel; 10-04-2013, 09:00 AM.


          • #6
            Re: dynamically setting report bitmap image file pointer

            Thanks Tom,
            your code and my code are both doing basically exactly the same thing, setting the bitmap objects file name dynamically in the OnPrintInit report event. Thanks, confirms this is a valid and useable strategy.
            Mike W
            "I rebel in at least small things to express to the world that I have not completely surrendered"


            • #7
              Re: dynamically setting report bitmap image file pointer

              My initial response was for a form, sorry I sent confusing messages.

              This is the code I put into the on_fetch event of a form that displays employee info along with their photo. This code retrieves the appropriate photo.
              (th is a pointer to the current "workers" table)

              G_EMP ="g:\bcbss\employee\g_employ.dbf",FILE_RO_SHARED)
              found = G_EMP.fetch_find(tc.Emp_ID)
              if found >0
              	badgeno = G_EMP.badge_no
              	dim Shared pict AS C
              	pict = alltrim(str(badgeno,9,0))
              	bmpfile = "g:\bcbss\photo"+chr(92)+trim(pict)+".jpg"
              	if .not.file_exists(bmpfile) then
              		bmpfile = "g:\bcbss\photo"+chr(92)+"not_avail.jpg"
              	end if
                	bmpfile = "g:\bcbss\photo"+chr(92)+"not_avail.jpg"
              end if
              Last edited by Tom Henkel; 10-07-2013, 08:15 AM.