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

Announcement

Collapse

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

Change BMP on report using expression ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Change BMP on report using expression ?

    If someone knows how to do this I won't have to replicate 97 reports just to change a logo . . .

    A5 v4.03 build 243 OR v5 build 268 (or later).

    Depending on which client work is being done for or invoices are being created for, we want to change a bitmap object on the report/invoice to their logo. Is there a way to do this in the report's expression builder (ie : make a calculated field that is a bitmap and change the bitmap based on CLIENT_ID ?) We are testing v5 in a production environment so we could use v5 for this app if any other beta testers have run across a way to do to do this in v5.

    I'll be in the woods in Maine shooting pictures (10/12 - 10/18) so I won't be able to get to the board to see your ideas, but Elliott usually logs on every day or so and can answer any questions that you might have.

    TIA
    Jim

    #2
    RE: Change BMP on report using expression ?

    Conditional object, field in ? table, object choice to display is desired logo?
    There can be only one.

    Comment


      #3
      RE: Change BMP on report using expression ?

      The logo isn't a field in a table it's an embedded bitmap.

      Comment


        #4
        RE: Change BMP on report using expression ?

        Jim
        A simple solution is use a generic name for the bitmap, like logo.bmp. Instead of embedding the bitmap, have the form or report look for the file "logo.bmp". Then save whatever logo you want to use as "logo.bmp". If the logo changes, just name the new bitmap "logo.bmp". Since the report, form or whatever looks for a file name, changing the contents of that file makes a easy change across the whole app.

        I have used this in a number of apps for backgrounds, logos, etc. You could even give the user an option to change the background or logo by saving a number of bitmaps and then creating a script to copy the desired bitmap to the name saved as the generic bitmap file.

        Jerry

        Comment


          #5
          RE: Change BMP on report using expression ?

          By the way, if you "shoot" a picture, do you have to take it to a taxidermist to get it mounted? Good shooting

          Comment


            #6
            RE: Change BMP on report using expression ?

            Your idea is good, except that more than 1 person will be using the app. Unless Operations makes sure that only work (orders, results, updates, and invoice prints/reprints) for 1 client is done for a given day, it would seem that the need for both logos could occur at the same time. I could also see how this might also cause errors (person 1 is causing logo to copy and person 2's script wants to copy the logo but the "file" is in use). (I can hear Operations now talking about hamstringing them.)

            The only way around this and other potential problems that I can see is if I put a directory path (C:/AppName/Bmps) on each workstation and explicitly name the path instead of allowing the network to assume it's on the server. That way your suggestion should work. Will test it when I get back next week. (Was supposed to be on the road a couple hours ago but you know how it is - can't leave a potential programming problem until it looks like it might be solved. Just glad I don't have a laptop, but then again I should worry about catching Coding Withdrawal Syndrome while being out in the wilderness.)

            Comment


              #7
              RE: Change BMP on report using expression ?

              Jim,
              Just in case you are now suffering from Coding Withdrawal Syndrome, here is another thought. (The pain and distress will go away shortly) If you are using a shadowed app for each user, aren't all forms, etc stored on the local computer in the shadowed data dictionary? In my apps, I also store the bitmaps in the local computer with the other A5 data files. On forms, etc, I do not specify a path for bitmaps, just enter the bitmap file name. Without a specified path, A5 looks in the local directory, which in the case of a shadowed app is the data path on the local computer. Therefore each shadowed workstation can have specific bitmaps.

              I have one app where two workstations are using different background bitmaps on a menu form for the same app. In both cases the bitmap is stored on the local computer as background.bmp. They are just different pictures.

              You could also store scanned signatures (I am lazy and don't write too gud) and allow each user to select what signature should be placed on a letter.

              Jerry

              Comment


                #8
                RE: Change BMP on report using expression ?

                What you could do is create a table that has a bitmap field and a cust_id field and just have the report print the bitmap in the table. This way you don't have to worry about any of that path stuff.... Also you said that you were using a beta v5, how can I get my hands on one or sign up to do beta testing ???????

                Comment


                  #9
                  RE: Change BMP on report using expression ?

                  I did this exact thing for a parts manual and it works great. Unfortunately, I'm not where I can get to it right now. I figured I'd post this in case I forget about it. If you don't hear from me by Sunday night, send me an e-mail to jog my memory - or what's left of it!

                  Cal

                  Comment


                    #10
                    RE: Change BMP on report using expression ?

                    Cal:

                    Thanks, Jim is up in the New Hamphsire area taking
                    photos--you know he has every kind of photo devise,
                    camara, lens, filter there is--or so it seems. And he's
                    good at it too.

                    What we are trying to do is private label service. We have done it prior by duplicating forms with different logos on the forms. Now,we have been asked by a competitor to
                    service for them as if we were them. So, on top of
                    doing what we do for our own customers, we will order,
                    provide results and the like to our competitor's customers
                    as if we were them. As a result we need to put their
                    logo on all of our many many reports (order forms, results completion forms, update forms, confirmation forms, invoices
                    and the like). We need to do this automatically and on the
                    fly. As far as the competitor's customers will know, it is our competitor, not us. Isn't technology grand, with caller Id, A5 we have a virtual office...

                    Regards

                    Comment


                      #11
                      RE: Change BMP on report using expression ?

                      Just got back last night. Fell victim to Coding Withdrawal Syndrome and rolled down part of a mountain (fortunately a bolder hit me in the shin and stopped me - lots of fun when driving a 5 speed back for 18 hours).

                      Looks like some good ideas. Will try to get to try them out soon. (You know how much stuff gets backed up when you're gone for a week. Have to catch up first.)

                      Thanks

                      Comment


                        #12
                        RE: Change BMP on report using expression ?

                        If you haven't seen it yet, go to the "Pointer to Pictures" topic. I put the script there - see my first posting that has an envelope next to it.

                        Cal

                        PS: Jim, have you played around with neutral density filters? I used to have fun taking pictures of 'empty' intersections and mall concourses.

                        Comment


                          #13
                          RE: Change BMP on report using expression ?

                          Cal,
                          As I posted to your original message, I found your method somewhat unreliable in reports. Works great on forms, but on reports it exibited some odd behavior. Copying your script exactly and even changing field and object name to the same as yours didn't change the behavior. I like your method and thing it is very imaginative, but for some reason events don't work as expected in reports. It works fine under the following conditions.

                          1. Report uses only one bitmap file value for the whole report.
                          2. Report uses a different bitmap for each page with only one bitmap per page. This only worked if the report was print previewed first.

                          The method failed under the following conditions.

                          1. Bitmap printed more than once per page with a different file value. Each bitmap displays and prints with the last bitmap found
                          2. Printed directly with no preview. No bitmap files found.

                          The problem seems to be with the OnRecord event. Just to check, I placed a trace.writeln() comment on the OnRecord event. If I printed without a preview, the event did not fire. Print preview did fire the event.

                          Some other interesting things I found from experimentation. It didn't matter if a default bitmap was saved as embedded or as a file. It also didn't matter if the file value was the result of using an object value or a value from a table pointer. In the end, I crreated a field with the file name for the bitmap I wanted to use and ended up with

                          topparent:bitmap1.bitmap.filename = alltrim(table.current().bitmapfile)

                          Worked exactly the same as your script. I really don't think the problem is with your script. It does work.

                          Jerry

                          Comment


                            #14
                            RE: Change BMP on report using expression ?

                            Jerry,

                            Would you consider sending me your app? Most of your comments sound familiar but I was able to work through them.

                            I'm not sure about multiple records on one page. As I recall, the app I worked on printed only one record per page but it did it quite reliably. (Bill Warner was the main developer - I just worked on this issue.)

                            Cal

                            Comment


                              #15
                              RE: Change BMP on report using expression ?

                              Cal,
                              Attached is a zip file of a test app I played with to test your ideas and other methods. I also found that the object properties method works perfectly on forms, usually on reports with the limitations mentioned in my previous post, and not at all on letters. I don't think the methods are wrong, but the problems are related to how and when A5 fires events. I also found that you can change the object size on forms using object properties, and it works consistently, but it doesn't work at all on forms.

                              Overall, this has been an interesting experiment. The only method that consistently worked everytime on forms, reports, and letters was to link to a file with a bitmap field and insert the bitmap field. This is ok if the number of bitmaps is small and the pictures themselves are not too big.

                              Jerry

                              Comment

                              Working...
                              X