It is currently April 26th, 2024, 10:16 am

Using Excel as a Rainmeter Skin

Get help with creating, editing & fixing problems with skins
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Hi, I do have one more question. I was trying to figure out how to get the times to align on the right side with this function StringAlign=Right ,however it either doesnt apply it to the text or it makes it disappear. any help on how to properly do it? :(

Also i was wondering if you could add another feature to this skin? I think it would make it much better than a simple table. Of course i dont want to pressure you into doing this if you dont want to, youve been helping me out a lot over the past days getting this working to my liking and im very grateful for that!

If you feel like doing it, the feature would be having 7 different excel files (one for each day of the week) and rainmeter cycles through them depending on the day. To add to that, adding a highlighting effect to the row that corresponds with the current time would be a nice touch.

So that in the end it would look similar to this picture, and the highlight could be some sort of semi-transparent yellow box highlighting the row depending on the time if possible.

Like always many thanks to everything you have been doing for me!! :) I appreciate it a lot!
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7170
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

JP2K wrote: August 30th, 2020, 6:44 amYou are amazing dude!!! Thank you so much for this feature!
Already? :???: What about multiple rows, multiple columns, multiple rows and columns (I think that's what you meant by "blocks"), or "customized" multiple rows and columns? :sly:

For coloring multiple rows (the 1st number is the start row, the 2nd number is the row count, both starting at 0):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)^(?:(?:^|\n).*?){11}((?:(?:^|\n).*?){3})
Multiple Rows.jpg
For coloring multiple columns (the 1st number is the start column, the 2nd number is the column count, both starting at 0):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)(?:^|\n)(?:.*\t){2}((?:.*\t|.*?){2})
Multiple Columns.jpg
For coloring multiple rows and columns (the 1st number is the start row, the following are start column and column count pairs for each row, all starting at 0; unfortunately due to how InlineOptions work, this couldn't be done by "counting" using a single pair of quantifiers - aka the {number} parts - so you have to manually paste the (?:^|\n)(?:.*\t){2}((?:.*\t|.*?){2}).*?-like part after {11} or whatever number you have there for as many times as the row count that you want to color, for example (?:(?:^|\n)(?:.*\t){2}((?:.*\t|.*?){2}).*?(?:^|\n)(?:.*\t){2}((?:.*\t|.*?){2}).*?(?:^|\n)(?:.*\t){2}((?:.*\t|.*?){2}).*? ), where each color actually represents a row):

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)^(?:(?:^|\n).*?){11}(?:(?:^|\n)(?:.*\t){2}((?:.*\t|.*?){2}).*?(?:^|\n)(?:.*\t){2}((?:.*\t|.*?){2}).*?(?:^|\n)(?:.*\t){2}((?:.*\t|.*?){2}).*?)
Multiple Rows And Columns.jpg
The latter can be customized (by changing the start column and column count values for various successive rows), e.g.:

Code: Select all

FontColor=255,255,255,255
InlineSetting=Color | 255,0,0,255
InlinePattern=(?U)^(?:(?:^|\n).*?){11}(?:(?:^|\n)(?:.*\t){0}((?:.*\t|.*?){3}).*?(?:^|\n)(?:.*\t){1}((?:.*\t|.*?){2}).*?(?:^|\n)(?:.*\t){2}((?:.*\t|.*?){4}).*?)
Multiple Rows And Columns - Custom.jpg
It's only now that everyone can be happy - not before everything possible was achieved. 8-)
Glad to help, by the way. ;-)
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7170
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

JP2K wrote: August 30th, 2020, 11:09 am Hi, I do have one more question. I was trying to figure out how to get the times to align on the right side with this function StringAlign=Right ,however it either doesnt apply it to the text or it makes it disappear. any help on how to properly do it? :(
First you have to understand something about the approach that was used to build this skin: the whole text is a single unit (or measure / meter in this case). There are no hundreds of meters or measures involved, just one measure and one meter ([MeasureFile] and [MeterFile]), that's it. In other words, stuff like StringAlign won't work here, because if you use it, you'll right align the whole contents of the meter (aka the whole "table" or [MeterFile]), not just one "cell" or another (like it would be the case if there were a TON of meters involved).

However, while the "right alignment" can be done from the skin through some Regex replacements in [MeasureFile], I think it would be much easier to set the Number Format to Text (insted of General) in Excel itself and then insert either leading 0-s or leading spaces in each cell having such a time frame. The same can be done for whatever other cell you want to "right align", of course. You'll probably have some minor drawbacks like the ability to sort things and such in some situations, but then, I don't think you do anything "advanced" in the skin, so it should be fine. This would make further modifications easier too, since no change to the skin code would be required and you'd tweak things as you want from a program that already makes stuff so much easier for the user and is built with such features.
JP2K wrote: August 30th, 2020, 11:09 am If you feel like doing it, the feature would be having 7 different excel files (one for each day of the week) and rainmeter cycles through them depending on the day. To add to that, adding a highlighting effect to the row that corresponds with the current time would be a nice touch.
Again, there is a simpler solution - keep the table as it is (if you need larger columns, you can work from the variables I told you or even set a slightly smaller font size, so you can fit everything on the screen) and highlight both the appropriate column for the day of the week and the appropriate row for the current time. Yes, this can be done (I actually anticipated that this might come along ever since your first posts in this thread) - I'm just saying it would save a lot of time and effort to keep things as they are right now, with no significant drawbacks involved.

So, let me know if you're ok with my suggestions. In the meantime, I already insterted leading 0-s in the Excel file's "times" (which are now formatted as Text) and leading spaces as well. Book1.xlsm below uses leading 0-s, Book2.xlsm uses leading spaces:
Book1.xlsm
Book2.xlsm
P.S. That being said, displaying only a single day is possible even if you're using one Excel file, by adding ,"(?siU)^(?:\N*(?:\R|$)){50}(.*)$":"\1" to [MeasureFile]'s Substitute option. This of course assumes that each day has 24*2+1=49 rows (obvious for a half an hour time interval plus the day of week headers) and that a blank line separates the days in the week in the Excel file. See below, where the 2nd instance of the schedule (numbered "1" in the top left corner) is grabbed - if you change {50} to {0} in the pattern above, you'd get the 1st instance (numbered "0" in the top left corner):
Book1.xlsm
You do not have the required permissions to view the files attached to this post.
Last edited by Yincognito on August 30th, 2020, 2:09 pm, edited 2 times in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Yincognito wrote: August 30th, 2020, 1:08 pm Again, there is a simpler solution - keep the table as it is (if you need larger columns, you can work from the variables I told you or even set a slightly smaller font size, so you can fit everything on the screen) and highlight both the appropriate column for the day of the week and the appropriate row for the current time. Yes, this can be done (I actually anticipated that this might come along ever since your first posts in this thread) - I'm just saying it would save a lot of time and effort to keep things as they are right now, with no significant drawbacks involved.
Yes, that would work and wouldn't be much of a problem. it would just look nicer and be easier to read, if it would switch tables depending on the current day. that way it doesn't take up as much space, since i have a lot of desktop files. To make it easier maybe adding a double click function to open the table that the day currently displays for easy access.
If its just 2 columns instead of 8 i can easily snap it to the left or right side of the desktop without causing much interference. Of course if its too much work then your solution will do just fine as well! :)
User avatar
Yincognito
Rainmeter Sage
Posts: 7170
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

JP2K wrote: August 30th, 2020, 2:06 pm Yes, that would work and wouldn't be much of a problem. it would just look nicer and be easier to read, if it would switch tables depending on the current day. that way it doesn't take up as much space, since i have a lot of desktop files. To make it easier maybe adding a double click function to open the table that the day currently displays for easy access.
If its just 2 columns instead of 8 i can easily snap it to the left or right side of the desktop without causing much interference. Of course if its too much work then your solution will do just fine as well! :)
Read the edit on my last post and tell me what you think.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Yincognito wrote: August 30th, 2020, 2:08 pm Read the edit on my last post and tell me what you think.
Yeah! That would be even better! So cool! Thanks a bunch! :)
User avatar
Yincognito
Rainmeter Sage
Posts: 7170
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

JP2K wrote: August 30th, 2020, 2:15 pm Yeah! That would be even better! So cool! Thanks a bunch! :)
What leading characters did you decide to use? Spaces or zeros?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Yincognito wrote: August 30th, 2020, 2:54 pm What leading characters did you decide to use? Spaces or zeros?
i used leading spaces :)
User avatar
Yincognito
Rainmeter Sage
Posts: 7170
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Excel as a Rainmeter Skin

Post by Yincognito »

JP2K wrote: August 30th, 2020, 2:56 pm i used leading spaces :)
Ok. This is what I'll do:
- change the Excel file to have multiple tabs, one for each working day of week (Monday to Friday), starting with the 2nd tab
- have the 1st tab display a "Summary" that "aggregates" all the following 5 days into one long (from a vertical point of view) list
- since as I pointed out, both the CSV and the TXT don't support multiple tabs, they will take just the 1st tab, which now just happens to be all you need, and this is where the skin will "navigate"
- when editing the Excel file, you will NOT edit the 1st tab (unless you know what you're doing), but edit instead the tab corresponding to the desired day of week (changes will be reflected in the 1st tab instantly in Excel, and of course, after saving, in the skin)

As for the rest, the time thing and such, I will do it no problem, just can't guarantee if it's going to be today or tomorrow. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
JP2K
Posts: 16
Joined: August 28th, 2020, 10:56 am

Re: Using Excel as a Rainmeter Skin

Post by JP2K »

Yincognito wrote: August 30th, 2020, 3:06 pm Ok. This is what I'll do:
- change the Excel file to have multiple tabs, one for each working day of week (Monday to Friday), starting with the 2nd tab
- have the 1st tab display a "Summary" that "aggregates" all the following 5 days into one long (from a vertical point of view) list
- since as I pointed out, both the CSV and the TXT don't support multiple tabs, they will take just the 1st tab, which now just happens to be all you need, and this is where the skin will "navigate"
- when editing the Excel file, you will NOT edit the 1st tab (unless you know what you're doing), but edit instead the tab corresponding to the desired day of week (changes will be reflected in the 1st tab instantly in Excel, and of course, after saving, in the skin)

As for the rest, the time thing and such, I will do it no problem, just can't guarantee if it's going to be today or tomorrow. ;-)
Sounds great! thank you so much! :rosegift: